Skip to content
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

fix(tooltip): custom renderer demo block #621

Merged
merged 3 commits into from
Mar 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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