moneyadviceservice/frontend

ClearInput clear button on search box is not clearing the search term from the box

ourmaninamsterdam opened this issue · 4 comments

Also, if you focus inside the search input box, hit ESC, the browser clears the input. But if you click on the X button, it populates the cleared search term again.

This has been resolved by #774 + #773, but since they're closed I wanted to raise something I've noticed working on accessibility reports from some of the calculators.

Voice input (on macs at least) doesn't trigger 'key' events. You can test this by turning on dictation within Dictation & Speech in Preferences, and then hitting fn twice while the search input is focused. It's not a showstopper here, but in other situations it might be.

The solution seems to be binding to the 'input' event. Browser support is mostly alright in IE8+, though there are a few quirks. I'd imagine binding to both 'input' and 'keypress'.

Again, it's by the by here, but worth watching out for.

Good spot @neoeno. It seems input is only supported in IE9+. But I saw this, which covers IE8 via the onpropertychange event.

@moneyadviceservice/frontend

This is resolved now?