Comments (7)
I had that thought initially. I could combine all of them so everything is out there. You can be explicit with events or control behavior via callbacks
from tooltips.
One of the things I dislike about github is that notifications are very out of the way. I'm always missing stuff.
This looks fabulous thanks for your work!
from tooltips.
I'll add this feature request to the next release.
Feature Description
Expose two new interface properties that define the showAction
and hideAction
of a tooltip. These properties will accept one of the following DOM event assignments:
- showAction:
click
,mousedown
,mouseenter
. - hideAction:
click
,mouseout
,mouseleave
.
from tooltips.
That's pretty cool and useful.
Might it be simpler to make methods that you could call using svelte/html events? That way it can be dealt with directly.
like for example
<div on:mouseleave|stopPropagation={() => tooltip.close()} />
open/close methods could then be used in non-tooltip situations... like for example a ux/ui tutorial, where they'd be fired on elements in a certain order, but only because $: if (tutorialStep === 3)
from tooltips.
That sounds great. Thanks and well done.
from tooltips.
After thinking about it, I'm just going to make the show
prop bindable and you can control the initial or close behavior by just setting that to true
or false
from tooltips.
you'll have something like this now
<script>
import { Tooltip } from '@svelte-plugins/tooltips';
let isVisible = false;
const hideOnClick = () => (isVisible = false);
</script>
<p>
This tooltip should appear to the
<Tooltip
bind:show={isVisible}
action="click"
align="center"
content="I should appear to the right."
position="right">
<b>right</b>
</Tooltip>
when clicked.
</p>
<button on:click={hideOnClick}>Close the tooltip</button>
from tooltips.
Related Issues (20)
- add manage of white-space: var(--tooltip-white-space); HOT 1
- Add conditional rendering
- Improve autoposition (container element boundaries)
- Typings?
- Thank you!
- Missing type definition for the tooltip action HOT 2
- Using additional on:mouseenter on element HOT 1
- 🐛 Tooltip has wrong position if it has a parent that's already positioned HOT 1
- 🐛 Tooltip has wrong position if it has a parent with absolute position and moved transform HOT 5
- 🐛 update positioning to handle resizing
- ✨ Don't show multiple tooltips at once
- 🐛 Tooltip does not close when clicked
- 🐛 When changing the "show" option, the tooltip does not change state
- 🐛 Tooltip has wrong position with positioned parent(s) HOT 2
- I don't think `hideOnOutsideClick` was merged in 3.0 HOT 3
- 🐛 HOT 3
- 🐛 Position: fixed + overflow: scroll bug.
- can't overwrite max-width style HOT 1
- Possibility on onclick HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tooltips.