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

fix(ui5-multi-input): focus tokens on BACKSPACE for inputs of type 'Number' and 'Email' #8866

Merged
merged 3 commits into from
May 2, 2024

Conversation

ndeshev
Copy link
Contributor

@ndeshev ndeshev commented Apr 26, 2024

related to #8712

Note:

To determine whether or not to focus the last token we rely on the JS's .selectionStart to check if the caret is at the start of the input (right before the tokens). However, Selection is only permitted with text/search, URL, tel and password. The likely reason that selection has been disabled for inputs of type number is that on some devices, or under some circumstances (e.g., when the input has been is presented as a short list), there might not be a caret.

So to determine if we should focus the last token in cases of inputs of type 'Number' and 'Email' now we check if there is a text value or not. This means that the (edge) case when there is a value and the user moves the caret to the start of it and then presses 'Backspace'/'Left Arrow' still won't work. IMO the issue doesn't seem to has a clean complete solution.

@nikoletavnv nikoletavnv self-requested a review April 29, 2024 14:43
@ndeshev ndeshev merged commit 7b5645d into main May 2, 2024
10 checks passed
@ndeshev ndeshev deleted the mi-num-mail-backspace branch May 2, 2024 10:31
ndeshev added a commit that referenced this pull request May 2, 2024
…umber' and 'Email' (#8866)

* fix(ui5-multi-input): focus tokens on BACKSPACE for inputs of type 'Number' and 'Email'

related to #8712
ndeshev added a commit that referenced this pull request May 2, 2024
…umber' and 'Email' (#8866)

* fix(ui5-multi-input): focus tokens on BACKSPACE for inputs of type 'Number' and 'Email'

related to #8712
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.

None yet

3 participants