Skip to content

Conversation

@danny-avila
Copy link
Owner

Summary

I refined the mobile device detection logic in the useFocusChatEffect hook to prevent unwanted focus behavior on mobile devices and ensure proper navigation state cleanup, given latest changes to Android and iOS.

  • Enhanced mobile device detection by checking both coarse pointer capability and hover support instead of relying solely on pointer type
  • Inverted the logic to handle mobile devices as the primary case, returning early when mobile-like behavior is detected
  • Extracted the path construction into a reusable variable to eliminate duplication
  • Preserved navigation state cleanup for both mobile and desktop cases while only focusing the textarea on true desktop devices
  • Added clearer logic flow that treats devices with coarse pointers OR lacking hover capability as mobile

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

Test the focus behavior across different device types to ensure the textarea only receives focus on desktop devices while navigation state is properly cleared on all platforms.

Test Configuration:

  • Desktop browser with mouse/trackpad
  • Mobile device (iOS/Android)
  • Tablet with touch input
  • Desktop with touchscreen capability
  • Browser responsive design mode

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit c602088 into dev Oct 15, 2025
4 of 6 checks passed
@danny-avila danny-avila deleted the fix/mobile-chat-focus branch October 15, 2025 12:12
@danny-avila danny-avila linked an issue Oct 15, 2025 that may be closed by this pull request
1 task
Francistab705 pushed a commit to Francistab705/LibreChat that referenced this pull request Oct 27, 2025
JustinBeaudry pushed a commit to Actual-Reality/LibreChat that referenced this pull request Nov 12, 2025
Guiraud pushed a commit to Guiraud/LibreChat that referenced this pull request Nov 21, 2025
patricksn3ll pushed a commit to patricksn3ll/LibreChat that referenced this pull request Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Keyboard Hides Input Window on Android

2 participants