-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE(web-twig): Tooltip plugin support only TooltipFloatingUI
- fix and update demo to match demos in react and web See the Tooltip: TooltipPopover enableControlledPlacement Prop section in the web-twig package Migration Guide to version 3.
- Loading branch information
1 parent
79e798d
commit 215dd2c
Showing
21 changed files
with
254 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
apps/web-twig-demo/assets/scripts/tooltip-placement-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Tooltip } from '@lmc-eu/spirit-web/src/js/index.esm'; | ||
import { Placement } from '@floating-ui/dom'; | ||
|
||
const radios = document.querySelectorAll('input[type="radio"]'); | ||
|
||
const tooltip = document.getElementById('tooltip-placements-example'); | ||
const tooltipText = document.getElementById('tooltip-placements-example-text'); | ||
const myTooltip = new Tooltip(tooltip); | ||
|
||
myTooltip.show(); | ||
|
||
radios.forEach((radio) => { | ||
radio.addEventListener('change', () => { | ||
const placement = (radio as HTMLInputElement).value; | ||
|
||
myTooltip.updateConfig({ placement: placement as Placement }); | ||
myTooltip.show(); | ||
|
||
tooltipText.textContent = placement; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.