Metadata
- Source
- FLUID-5672
- Type
- Improvement
- Priority
- Major
- Status
- Open
- Resolution
- N/A
- Assignee
- N/A
- Reporter
- Justin Obara
- Created
2015-05-29T07:44:32.237-0400 - Updated
2021-07-29T01:32:48.839-0400 - Versions
- N/A
- Fixed Versions
-
- 5.0
- Component
-
- Tooltip
Description
Currently the tooltip component takes in an option for "items" which gets passed down to the widgetOptions and eventually makes it way directly into the underlying jQuery UI tooltip widget. The items option is used to define which elements should show the tooltip. http://api.jqueryui.com/tooltip/#option-items
The default in Tooltips.js is set to "*", which means all elements. The result of this is that if a tooltip is set for an element that has child elements, a new tooltip is created as the mouse passes over each of these DOM elements instead of just the parent. (see: FLOE-361)
An alternative solution could be to make use of the idToConent to calculate the correct elements, by ID, to use for the items. However, because the tooltip supports both idToContent and a straight content model the items option is still required for the latter case. We will need to have appropriate logic to know when to attempt to calculate the items as well as the ability to update the items if any of the ID's in the idToContent model object are modified after initialization.
Comments
-
Simon Bates commented
2015-06-15T15:23:04.852-0400 Comments from Antranig in #fluid-work:
[14:49] <Bosmon> simonjb - another useful piece of work would be to adjust the implementation so that it automatically skips disabled DOM nodes in fluid.tooltip.resolveTooltipTarget
[14:49] <Bosmon> simonjb - https://github.com/fluid-project/infusion/blob/master/src/components/tooltip/js/Tooltip.js#L61
[14:49] <Bosmon> This was something that we hacked in the FD tool at the last moment
[14:50] <Bosmon> but it requires the implementor to explicitly add the wacky :not([disabled]) annotation at the end of the tooltip items selector
[14:50] <Bosmon> simonjb: https://github.com/fluid-project/first-discovery/blob/master/src/js/firstDiscoveryEditor.js#L129