-
Notifications
You must be signed in to change notification settings - Fork 21
feat(components): enable open animation on <post tooltip>
#6821
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
base: main
Are you sure you want to change the base?
feat(components): enable open animation on <post tooltip>
#6821
Conversation
🦋 Changeset detectedLatest commit: de27e1d The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…tooltip-and-popover
…ot-actually-applied-to-post-tooltip-and-popover
…tooltip-and-popover
…-popover' of https://github.com/swisspost/design-system into 6617-animation-not-actually-applied-to-post-tooltip-and-popover
|
| @Method() | ||
| async toggle(target: HTMLElement, force?: boolean) { | ||
| await this.popoverRef.toggle(target, force); | ||
| this.focusFirstEl(); |
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.
Can we avoid calling this function when we toggle to false?
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.
I 'm not sure. I had already thought about it, but currently post-menu toggle() calls it like this - without the force: this.popoverRef.toggle(target). Would you prefer updating the post-menu?
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.
No, that was not my intention, but it would be good if it does the exact same thing.
I just had a look into your PR and I think we can do the following to optimize this functionality:
async toggle(target: HTMLElement, force?: boolean) {
// you can expect the popoverRef.toggle function to return the current state (after toggling), no matter if we call it with a `force` parameter or not ;)
const isOpen = await this.popoverRef.toggle(target, force);
if (isOpen) this.focusFirstEl();
}This is only a micro improvement reguarding performance, but it could save us from unwanted side-effects.
| @Method() | ||
| async toggle(target: HTMLElement, force?: boolean) { | ||
| await this.popoverRef.toggle(target, force); | ||
| this.focusFirstEl(); |
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.
No, that was not my intention, but it would be good if it does the exact same thing.
I just had a look into your PR and I think we can do the following to optimize this functionality:
async toggle(target: HTMLElement, force?: boolean) {
// you can expect the popoverRef.toggle function to return the current state (after toggling), no matter if we call it with a `force` parameter or not ;)
const isOpen = await this.popoverRef.toggle(target, force);
if (isOpen) this.focusFirstEl();
}This is only a micro improvement reguarding performance, but it could save us from unwanted side-effects.
<post tooltip><post tooltip>



📄 Description
This PR updates
<post-tooltip>so that it now correctly uses the open animation provided by<post-popovercontainer>, which was previously not visible.Additionally, but not directly connected to the scope of the current ticket it:
<post-popover>component. (Popover animation has already been enabled in the [bug] fix post-menu animation #6538 )🔮 Design review
📝 Checklist