Skip to content

Conversation

@Seb33300
Copy link
Contributor

Trying to fix the same issue as #104 but with a different approach.

On mobile, if the header or footer contains an input field, we have an issue where the mobile phone open and close the keyboard continuously on the input field focus.

This happens because when the keyboard opens, the resize event is triggered which is the event triggering the fixer header "redraw". The focus is lost during the redraw because the dom element is moved, and then, focus is reapplied to the previous active element. Which result in an infinite loop (re focusing the input will reopen the keyboard triggering resize event...).

With my fix, we skip the redraw if the fixed header is already properly positioned.

@AllanJard
Copy link
Contributor

That sounds sensible to me - thanks for the PR. Are you happy for this to be included under the MIT license?

@Seb33300
Copy link
Contributor Author

Are you happy for this to be included under the MIT license?

Yes!

@AllanJard AllanJard merged commit 1f90631 into DataTables:master Jan 28, 2025
@AllanJard
Copy link
Contributor

Thank you :)

@Seb33300 Seb33300 deleted the fix-mobile branch January 29, 2025 07:37
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.

2 participants