Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Pager Search Input Text Field Autocomplete Behavior #3931

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

leigh-pointer
Copy link
Contributor

This pull request enhances the behavior of the search input text field by disabling the browser’s autocomplete feature. Here’s why I’ve opted for the

tag approach:

Form-Level Control:
By placing autocomplete="off" on the tag, we ensure consistent behavior across all input fields within the form. Although only one field, adding it to the Input control gives strange effects across browsers.

Edge Compatibility:
As mentioned earlier, Edge 18 has limited support for autocomplete="off".
By setting it at the form level, we address this issue globally for all browsers, including Edge.

Why This Matters:
Improved user experience: Users won’t be distracted by irrelevant autofill suggestions.
Consistency: The search input field now behaves uniformly across browsers.

Note for Edge Users:
While autocomplete="off" works as expected in Chrome and Firefox, it may have limited support in Edge (specifically Edge 18). Users of Edge 18 are advised to disable autofill from the browser settings directly.

This pull request enhances the behavior of the search input text field by disabling the browser’s autocomplete feature.
@sbwalker
Copy link
Member

sbwalker commented Mar 2, 2024

@leigh-pointer I suspect the other problem is that the id of the input element is "search" - which is very generic and since browsers use the id/name as the key for form autocomplete it increases the probability of it relating the wrong information to this element. If we changed the id to "pagersearch" it would be more unique and would probably cause less problems.

@leigh-pointer
Copy link
Contributor Author

@sbwalker i will give that a try.

@sbwalker
Copy link
Member

sbwalker commented Mar 2, 2024

@leigh-pointer we can also add the autocomplete attribute as it will help in some browsers

Changing the ID had no effect and on further investigation the best way to achieve this is to use the form tag which is a lot stronger implementation.
@sbwalker sbwalker merged commit 32e1ade into oqtane:dev Mar 2, 2024
1 check passed
@leigh-pointer leigh-pointer deleted the autocomplete branch March 4, 2024 07:18
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