question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Select All' not clearing the country selection

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
catamphetaminecommented, Feb 26, 2020

Ah, I see what you mean. So, for example, if I enter 1 213 2222222, then it selects US. 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.

0reactions
catamphetaminecommented, Feb 29, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found