Skip to content
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

[EuiSelectableTemplateSitewide] Allow default a link behavior for results #7787

Closed
rshen91 opened this issue May 23, 2024 · 3 comments
Closed

Comments

@rshen91
Copy link
Contributor

rshen91 commented May 23, 2024

I'm opening this issue to reference in a future PR of mine. The global search component within Kibana is using the EuiSelectableTemplateSitewide component and in issue elastic/kibana#147710 I am tasked with having the default link behavior of cmd + click open the global search results into a new tab.

Some avenues I plan to explore in a PR through EUI is through the renderOptions prop to have the <li> from EuiSelectableList be wrapped in an tag. I want to make sure that this doesn't impact styling.

The pickle with window.open() is that we want to use Kibana's navigateToUrl() function that prevents full reloads of Kibana to make it a better user experience.

This issue seems connected to this already existing issue #6376 (but please correct me if I'm wrong).

@cee-chen
Copy link
Contributor

cee-chen commented May 29, 2024

Hey Rachel! Real quick, can we get a priority level from you/your team on this and when you'd want this by?

There are accessibility concerns here (the option roles that selectable items naturally come with, that might clash with link/<a> tags) that we'd need to loop @1Copenut in on, which would take a little while as he's out on PTO right now.

In the interim, I think elastic/kibana#147710 is resolvable without needing native <a> link rendering - you simply need to detect ctrl/cmd keypress in the click event (see #5408 (comment)).

The pickle with window.open() is that we want to use Kibana's navigateToUrl() function that prevents full reloads of Kibana to make it a better user experience.

This sentence doesn't make sense to me, I'm sorry. A new page/tab will always cause a full load of Kibana in any case, that's straight up how they work. Default link behavior wouldn't change this. window.open() is frankly as close to browser-level new tab behavior as it gets. Can you clarify exactly why this wouldn't work for you all?

@1Copenut
Copy link
Contributor

1Copenut commented Jun 3, 2024

@cee-chen is right mentioning the option roles will compete with the A tag's natural link role. I also think wrapping the option list item with an EuiLink will create a markup pattern UL > A > LI that will throw axe-core errors due to improper child rows existing in the list.

It's perfectly valid to add a click handler to the list item so we can open that item in a new tab. We should also consider keyboard behavior allowing users to Cmd/Ctrl + Enter keypress to open the item in a new tab. This is also a default behavior.

The trick will be communicating to screen readers that these non-links will behave like links including opening in new tabs using default user behaviors.

LMK if I've missed the original problem statement or you'd like to discuss further.

@rshen91
Copy link
Contributor Author

rshen91 commented Jun 4, 2024

Sorry! I did a fix on the Kibana side that was merged recently - elastic/kibana#183762
Closing!

@rshen91 rshen91 closed this as completed Jun 4, 2024
@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants