fix(ui5-multi-input): focus tokens on BACKSPACE for inputs of type 'Number' and 'Email' #8866
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.