Comments (3)
Hi @multimeric,
Thanks for raising this. The data attribute you're referring to is indeed how Bootstrap JS works. However because Plotly Dash and all component libraries are built on React, the underlying implementation is quite different. In particular, this library is built on top of React-Bootstrap. You can see how Tooltips work here, and you'll notice it's quite different.
The ID / target pattern was arrived taking into account various constraints including limitations of Dash itself (some of which have been addressed since the first version of this library came out), and the way things are implemented in Reactstrap (a different React library with Bootstrap components that was originally the basis for dbc).
I'm open to alternative patterns that make things easier, as long as changes are backwards compatible.
Regarding your two suggestions, they both suffer from a major problem which is that I don't see how we could implement either option in a way that doesn't only work for components in this library. E.g. suppose I wanted to add a tooltip to a html.Div
. We can target a particular id, but we don't have the ability to add a custom prop, nor do I see atm how we could search the whole tree of components for those data attributes.
from dash-bootstrap-components.
Okay, I see your point. From looking at the React Bootstrap docs, I wonder if adapting the following would be okay:
const Link = ({ id, children, title }) => (
<OverlayTrigger overlay={<Tooltip id={id}>{title}</Tooltip>}>
<a href="#">{children}</a>
</OverlayTrigger>
It's true that they use id
here, but I don't think it's mandatory. We could call the Link
element something more appropriate.
from dash-bootstrap-components.
Related Issues (20)
- [Bug] Console warning on dbc.Tooltip component HOT 3
- Web site is not showing components HOT 5
- Graphs in tabs example not rendering HOT 2
- Support 'clearable' in Input HOT 1
- Allow not showing up-down arrows in numeric HOT 1
- [BUG] dbc.Modal(style) is passed to fade-modal-show layer instead modal HOT 3
- dbc.TextArea n_submit should not increment for Shift+Enter? HOT 3
- Consider Supporting Hyperlinks in Carousel Images HOT 6
- Dropdown presentation in data table doesn't work HOT 1
- Keyword argument for value OR placeholder HOT 2
- BUG: max doesn't work on nested progress bar HOT 3
- Docs app not working with Dash 2.14.0 HOT 3
- Allow icons and html in `dbc.AccordionItem()` title HOT 3
- Remove migration guide in docs
- selected attribute for dbc.Select HOT 1
- `dbc.Checklist` does not accept `label` as `list[Component]` like `dcc.Checklist` does HOT 3
- dash_bootstrap_components version versus python version HOT 5
- Nested tabs in `Offcanvas` component trigger scroll up event on tab change HOT 2
- Tooltip closing race condition with children change callback HOT 10
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 dash-bootstrap-components.