You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When Tom Select is initialized on a form field that is set to be autofocused, the field loses its focus immediately upon page load. This issue occurs regardless of whether the autofocus attribute is set directly in the HTML or programmatically via JavaScript. This behavior disrupts user experience, especially in forms where immediate input is expected upon loading the page.
Initialize Tom Select on this input using the standard initialization code.
Load the page in a browser and observe that the input does not retain focus.
Expected Behavior:
The input field should retain its focus when the page loads, allowing users to start typing immediately without having to click on the field.
Actual Behavior:
The input field loses focus as soon as Tom Select is initialized, requiring users to manually click on the field to start typing.
Additional Information:
This issue does not appear to be browser-specific as it replicates across multiple major browsers.
A potential workaround could involve programmatically setting focus back to the input after initializing Tom Select, but this is not ideal for all use cases.
Suggested Fix:
The initialization of Tom Select might benefit from a check to retain focus if the target element has the autofocus attribute or if it is already focused before initialization. Adjusting the library to check and restore focus could resolve this issue.
The text was updated successfully, but these errors were encountered:
Bug description
Description:
When Tom Select is initialized on a form field that is set to be autofocused, the field loses its focus immediately upon page load. This issue occurs regardless of whether the autofocus attribute is set directly in the HTML or programmatically via JavaScript. This behavior disrupts user experience, especially in forms where immediate input is expected upon loading the page.
initially reported in sqlpage/SQLPage#297
Steps to Reproduce:
autofocus
attribute on this input.Expected Behavior:
The input field should retain its focus when the page loads, allowing users to start typing immediately without having to click on the field.
Actual Behavior:
The input field loses focus as soon as Tom Select is initialized, requiring users to manually click on the field to start typing.
Additional Information:
Suggested Fix:
The initialization of Tom Select might benefit from a check to retain focus if the target element has the
autofocus
attribute or if it is already focused before initialization. Adjusting the library to check and restore focus could resolve this issue.The text was updated successfully, but these errors were encountered: