-
Notifications
You must be signed in to change notification settings - Fork 834
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
[EuiSkipLink] Fix TS types and Safari click issue #3665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just a couple type export things.
Why is that? The |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3665/ |
Yeah I understand this, but we need to be flexible at the same time. We enforce good/appropriate behavior through our documentation and examples while still being open about "necessary" vs "best practice". We shouldn't shut consumers out from using certain components when it's the appropriate component. |
|
Intended use of skip links is to:
In the original PR, I argued for it to be as prescriptive and restrictive as possible to that. If y'all want to continue down that path, allowing |
I would like to keep |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3665/ |
A couple issues arose when trying to use this component in Kibana.
Props
Interactive props
There was a simple code error where the component's props was not all the props. It was referencing just the
EuiSkipLinkProps
instead of theProp
one which includes thePropsForAnchor
andPropsForButton
props to allow foronClick
and such. So TS threw an error when trying to addonClick
destinationId
This prop was required but is too specific to only one possible use case/consuming ability. For instance, Discover's "Skip to bottom of table" button still has an Angular wrapper and so it needed to do the functionality via anonClick
and not anhref
. I just made this one optional.Update: Is still required
Safari
The browser had a weird state when you couldn't click the button with a mouse when in the focus state. As soon as you mouse down, the button would disappear again. I was able to fix this by appending
:not(:active)
to the selector for when to hide the button. This seems to fix the issue.Before
After
Checklist
[ ] Checked in mobile[ ] Added documentation[ ] Checked for breaking changes and labeled appropriately