'Select All' not clearing the country selection
See original GitHub issueWhen using the default entry method (the topmost on demo page), cleaning the input field with backspace clears the country selection as well, but selecting the input field with cmd+a
(select-all) and then typing over it does not clear the country selection.
Example use case is, start typing a phone number without country code, realize that a country code is needed when seeing the flag after few key strokes, backspacing the entry and typing again with country code works as expected, but cmd+a
and typing the country code does not produce the same result just adding the new country code after the old one.
Not sure if it is possible to detect that the input field is empty just before the first keystroke.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to clear old values on click of country and state in the form?
Below code shows you how to clear the "state" dropdown and store the value of previously selected state into a hidden variable.
Read more >Clear or remove a filter - Microsoft Support
Remove all the filters in a worksheet If you want to completely remove filters, go to the Data tab and click the Filter...
Read more >Using Select By Location—ArcMap | Documentation
Click Selection > Select By Location to open the Select by Location dialog box. Choose the type of selection that you want to...
Read more >How To Select All on Your Computer, Smartphone or Tablet
Learn how to use the "select all" feature for editing text and images on your computer, smartphone or tablet.
Read more >Distribute app releases to specific countries - Play Console Help
Select Release > Production > Countries/regions. Update your app's country selection. If you add a country for a paid app, new prices are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I see what you mean. So, for example, if I enter
1 213 2222222
, then it selectsUS
. Then, if a user selects all and hits Backspace, it resets the country. But if a user selects all and starts typing without hitting backspace, then it doesn’t reset the country. The reason is that when a country is selected, any input is valid, but when a country is not selected, then only+
input is valid, and that’s why+
is selected. It doesn’t “need” a+
. It only “needs” it if there hasn’t been any country selected before. Perhaps it should also reset country when there was an international number, and then user selects all and types a digit? Maybe. I’ll reopen this for now.After thinking about this feature for a bit, I’ve concluded that resetting country when user’s input changes from a number with a
+
to a number without a+
wouldn’t be a 100% correct user experience, because a user might want to input a phone number for the currently selected country in local format (without+
). Resetting the country does make sense when a user erases the number completely because this way there’s a moment in time when the user sees that the country has been reset for an empty input, and so they’ll understand why the digits they’ve started typing are prefixed with a+
: because immediately before they start typing digits there would be no country selected. In a scenario with “Select all” and start typing there’s no such time frame in which the country flag is reset, so it wouldn’t be intuitive if a users wants to input a local number.