Closed YoruNoHikage closed 1 year ago
Well, maybe changing links and routing isn't necessary? Or you could debounce it to make it easier to manage.
Okay I played a bit with it tonight, maybe it was just me but everything pretty much works. Still, there are some behaviors that are not ideals and maybe that was the reason I picked this broken solution above instead. Accessibility is back but I don't see anything other than:
Well, maybe changing links and routing isn't necessary? Or you could debounce it to make it easier to manage.
Routing is kind of necessary, the page can be shared. It's also part of the web browsing history making it natural to go back and forth between results and the search page. Debouncing the navigation could temporarily mitigate this annoying thing though.
Routing is kind of necessary, the page can be shared. It's also part of the web browsing history making it natural to go back and forth between results and the search page. Debouncing the navigation could temporarily mitigate this annoying thing though.
That certainly applies to classic websites. How does Google do it? I think it's autocomplete then the url only changes when you press enter. Maybe combining the both wasn't the best solution after all. Mea culpa on that one.
When tabbing through the menu, once we get to the search field, and we tab again, the focus is lost. This is due to the navigation going to
/search
page when focusing, going back to/
is the field is empty when we leave the field.The ideal behavior is:
/search
./
.But due to Next's routing system, this is hard to accomplish (if not impossible?), you lose the focus making the cursor jump to the start of the input. If the state is local, you lose it as well.
An alternative plan is something I've come up for now:
/search
.a. Input empty: the blur event makes you navigate back to
/
, losing focus. ⚠️ b. Input filled: tabbing again focuses the next elementI need to look back at what was really blocking regarding Next's router's behavior and investigate is there isn't a way we can achieve the ideal behavior stated above.