raucao / webmarks

remoteStorage-enabled bookmarking app
https://webmarks.5apps.com
Other
76 stars 11 forks source link

Select text in search field #52

Closed benrubson closed 6 years ago

benrubson commented 7 years ago

Hello,

This feature request follows #46. Would be nice for the text (inside the search field) to be selected when the search field is focused. So that we can then search for something else very quickly when we come back to the Webmarks page.

Many thx 👍

Ben

raucao commented 7 years ago

Thanks for your request, Ben! Are you talking about mobile or desktop usage? I'm not a fan of JavaScript getting in the way of standard UI behavior, so on desktop I'd prefer to have the user select the text themselves in case they want to replace it.

However, on mobile it's not so easy to select text, so the usual way to ease clearing of search fields is a delete (x) button on the right hand side. I think this could be useful for sure.

benrubson commented 7 years ago

Thank you for your answer Sebastian ! I'm talking about desktop usage :) This request follows #46 where search field is now re-focused after something has been clicked. This of course improves user experience, speeds up Webmarks usage.

I then think it could even be better if, when there is some text inside the search field, in addition for the field to be focused, the text could also be selected. So that the user can type something new without having to first clear the field.

Of course I think this requires some JS (select() function I think).

raucao commented 7 years ago

I'll check it out.

benrubson commented 6 years ago

Some news regarding this ? :) Many thanks !

raucao commented 6 years ago

No news. Last thing I did was updating the underlying framework and all code. I'll have a go at this one next.

benrubson commented 6 years ago

OK, thank you Sebastian 👍

raucao commented 6 years ago

I just deployed a new version, which shows a button for clearing the search field when it contains text. This should solve it nicely on both mobile and desktop. (It will also keep/re-set the focus on the field when clicking it.)

I also improved the layout of the search field a little bit.

benrubson commented 6 years ago

Thank you Sebastian 👍

Use case was also the following : you search for a bookmark, click on it, read this new opened page. You come back to Webmarks and want to search for another bookmark. It would then be nice for the previous searched text to be selected, so that you can enter new text directly without having to click / select or whatever. Do you then see why I would have liked the text to be selected ?

raucao commented 6 years ago

I understand the use case, but I don't think selecting text is the best way to go here in regards to balancing various different use cases. The field already has focus, so in order to select the text before typing more, you could just press CTRL+A for example. But you could also decide to add more text to the search phrase.

I'm open to check out any pull requests changing this behavior, but I'll leave it like this for now. It's very similar to almost every search field on the Web, but with the added auto-focus when coming back.

benrubson commented 6 years ago

Understood, thank you for your feedback Sebastian 👍