[EuiSkipLink] Fix TS types and Safari click issue#3665
[EuiSkipLink] Fix TS types and Safari click issue#3665cchaos merged 6 commits intoelastic:masterfrom
Conversation
thompsongl
left a comment
There was a problem hiding this comment.
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
EuiSkipLinkPropsinstead of thePropone which includes thePropsForAnchorandPropsForButtonprops to allow foronClickand such. So TS threw an error when trying to addonClickdestinationIdThis 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 anonClickand 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