Skip to content

Commit

Permalink
fix(tooltip): custom renderer demo block (#621)
Browse files Browse the repository at this point in the history
* fix(tooltip): fix tooltip selector of custom renderer demo block

* fix(tooltip): deregister overflow tooltip for elements in custom renderer demo-block
  • Loading branch information
wattachai-lseg authored Mar 9, 2023
1 parent f3c4c77 commit 3156ccd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/elements/src/tooltip/__demo__/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,16 @@
<span>If the tooltip does not fit the screen, it repositions or shrinks itself for the best fit. Try to manipulate with screen size and scrollbars to see how does it work.</span>
</ef-item>

<ef-tooltip id="item-tooltip" selector="#custom-renderer item"></ef-tooltip>
<script>
<ef-tooltip id="item-tooltip" selector="#custom-renderer ef-item"></ef-tooltip>
<script type="module">
import { deregisterOverflowTooltip } from '@refinitiv-ui/elements/tooltip';
setTimeout(() => { // deregister these elements from the default overflow tooltip as a custom renderer would do that instead.
const coralItemList = document.querySelectorAll('#custom-renderer ef-item');
coralItemList.forEach(element => {
deregisterOverflowTooltip(element);
});
}, 50);

(function () {
const tooltip = document.getElementById('item-tooltip');

Expand Down

0 comments on commit 3156ccd

Please sign in to comment.