glanceapp / glance

A self-hosted dashboard that puts all your feeds in one place
GNU Affero General Public License v3.0
8.56k stars 297 forks source link

Better autofocus, to make it work on mobile somehow #258

Open develoopeer opened 1 week ago

develoopeer commented 1 week ago

Whats the point

As mentioned in issue #208, autofocus attribute on search bar do not works on mobile devices. This is due to security restrictions of Android/IOS devices. Keyboard cant be toggled without any kind of user interaction. Here's what people from react-select who have encountered the same problem say about it

I don't think there is any workaround in this case, to make this functionality works. But this PR, adding border animation on search bar to make them works like in desktop version. Without this change, user can`t even figure out, that autofocus flag is enabled, because borders are blurred.

svilenmarkov commented 6 days ago

Thanks for contributing!

I tried both the current implementation as well as this one and the behavior appears to be the same - the field gets focused and receives the colored border, but as you mentioned, the keyboard does not appear due to security restrictions. Is the field not getting focused for you at all with just the autofocus attribute?

develoopeer commented 6 days ago

Yes the field wasn't getting any focus at all, but today i tried to reproduce this, and eventually nothing happening. I am using Mobile version of Chrome v130.0.6. I do not know why this behavior no longer appears, maybe i was doing something wrong. If this case was just false positive, there is no need to merge this PR, because it will just make things more complicated. Sorry for bothering