This is a similar component to Modal, maybe it needs to be written to be called via Context, we have to evaluate if it is necessary to create a low-level for it and do the same as we did for Modal.
cc @bryceosterhaus
For this component, we might want to leverage some sort of HOC that wraps the app. We could then add an event for hover on any element that matches a certain selector and automatically add a tooltip via the title attribute.
Check out Faro's tooltip implementation for example. https://github.com/liferay/com-liferay-osb-faro-private/blob/development/osb-faro-web/src/main/js/shared/components/Tooltip.jsx
Not sure if youll need access to the repo or not.
FYI, we have this long-standing request by @drakonux about the tooltip behaviour: https://github.com/liferay/clay/issues/1988
Might be good to implement this on v3 to stay on his good side 馃槈
I think that would be ideal but we also have to remember to add an attribute or some way that allows people to set the starting or preferable position. This is important, there are some designers that define it.
@matuzalemsteles yeah for sure. Faro adds a data- attribute to customize that. I'll look into adding both a high and low level API for this. Shouldn't be too difficult I dont think.
we might want to leverage some sort of HOC that wraps the app. We could then add an event for hover on any element that matches a certain selector and automatically add a tooltip via the title attribute.
I'm curious about why you'd need a HOC for this, and whether it would cover all the use cases. For example, will your event listener attach to the document.body so that it can see events on arbitrary elements (given that a React.createPortal() call could effectively mount an element anywhere)? And if it does that, it feels like you need context, may as well make a hook for it, may as well rely on React's event delegation etc, and I am not sure what a HOC would give you.
@wincent yeah you are right, itll likely be context and not an HOC. Thats what I had originally meant but obviously was not thinking straight while typing it.
FYI, we have this long-standing request by @drakonux about the tooltip behaviour: #1988
Might be good to implement this on v3 to stay on his good side 馃槈
Please Clay come to the Light Side :D
Yeah guys, please take a look on the Time Delay ticket for Tootlips. Lexicon Team agrees with the proposal I made :P
hey @drakonux this is totally valid. @bryceosterhaus is already working on this in #2347