New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open a suggestion in a new tab #207
Comments
I just tried wrapping every suggestion in a native link. So I would need to avoid that behaviour. |
a native link is the way to go in most cases I think when the behaviour is linking :) |
Yes @Haroenv , however I now need to figure out how to not close the dropdown when a link is clicked. |
I was about to open a similar issue. This is an accessibility problem to me. If you press Enter while keeping the ⌘ or Ctrl key, the link should also be opened in a new tab (the same goes for ⇧ in a new window). |
In my opinion this breaks standard UX expectations and is a bug. |
you should make template |
Totally agree that users should natively be able to ctrl+click to open the autocomplete link in a new tab. |
Any development on this? It's definitely something users want to see, to quickly search then open in a new tab so that you can manage your search workflow better. I am not sure about @zoransa answer - is that to be added to the /assets/js/orders-autocomplete.js ? |
Reading the comments, one solution would be:
|
exactly what I thought should work too. I recently made a trial on how to do that (in userland): https://codesandbox.io/s/nwm9qpmqj But I think something odd is going on since it reloads the page, rather than navigating, but that might just be codesandbox |
@Haroenv that demo works fine for me in Chrome on Windows. I can
|
Ah that's good, it probably was just codeSandbox being odd then. We probably could have an option to make this the default or (maybe preferred now) document this way of using it in the template |
@Haroenv your demo breaks keyboard navigation :) I was looking into this issue as well and as @rayrutjes said, from the |
A proposal would be to trigger Or maybe enrich the actual event with an |
@pixelastic I think at this point we should change the current implementation so that everybody benefits from this accessibility improvement. @s-pace told me he made some local changes to the library to support this feature. Are you ready to share them? |
The changes works fine with click but don't support keyboard interaction. I have basically wrap my element in a tags. To enable keyboard interaction I can wrap these element in I would love to see implemented what @pixelastic offer. Happy to help doing it |
@francoischalifour As @s-pace mentioned we tried to change the suggestion template to Considering that anyone can change the templates of an autocomplete.js integration, I don't think we should add a specific behavior that expects the suggestion template to be a @s-pace Could you explain how you would wrap the elements in |
FYI, v0.33.0 adds a |
I'd like users to be able to open suggestions in a new tab.
I was looking to implement something like this to detect if the intention was to open the link in a new window.
Unfortunately we have no context about the original event that triggered the "autocomplete:selected" event.
I guess this leaves us we the only alternative to display all suggestions as native links.
The text was updated successfully, but these errors were encountered: