CUModSquad / Camelot-Unchained

UI repository for Camelot Unchained, a tri-realm RvR MMORPG.
Mozilla Public License 2.0
7 stars 25 forks source link

update content and style of the tooltip, if its parent element did update… #283

Closed UmbarPantera closed 5 years ago

UmbarPantera commented 5 years ago

…, so the tooltip matches the values of the element, that displayed it.

If the parent element rerenders, the tooltip is rerendered as well, but the state of the tooltip view was not updated. If the parent element (and the tooltip) did update there is a checked now, if the mouse is over the parent. Only in this case an update event is triggered. If the tooltip view is visible, it's state (content and style) is updated based on the data from the event and the tooltip matches the data of the parent element again.

This solves the problem reported here

Ajackster commented 5 years ago

Looks good, added some changes on top of your commit locally that I'll be pushing up. Pretty much just throttle the updates, as well as only update if certain values provided to the Tooltip component change instead of whenever.