New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LPS-124430 Saves tooltip trigger title on show events #629
Conversation
CI is automatically triggering the following test suites:
|
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPS-124430 1 Successful Jobs:For more details click here. |
Before, the change of `title` to `data-restore-title` happened based on the component rendering and state, making it fail to execute under certain conditions. With this change, anytime the mouse moves over a tooltip trigger, its `title` attribute is moved to a `data-restore-title` attribute avoiding unnecessary rendering of the native tooltip.
ci:stop |
I somehow managed to mangle a one-line commit 🙈 |
ci:stop |
Target exception: java.lang.RuntimeException: Unable to find properties for git.portal.properties Base Branch:Branch Name: master Branch GIT ID: ff0e5e147ea14773fc626b3a4024d041bfefb138 Job Summary:Job Link: test-portal-acceptance-pullrequest(master) For more details click here. |
ci:test:sf |
ci:test:relevant |
Jenkins Build:test-portal-source-format#3864 |
@jbalsas the other day between two tasks, I saw this one on the issue board and have the exact same change in a branch |
@jbalsas how did you generate that diagram? |
Jenkins Build:test-portal-source-format#2194 |
I don't see how that test can be related... let's give this another 2 and a half hours of our lives just to be sure! |
ci:test:relevant |
Jenkins Build:test-portal-acceptance-pullrequest(master)#4002 |
@john-co, @PablitoBonito could you see if this related after all? Failed twice in a row, so it's either that or already broken upstream 🤔 |
Jenkins Build:test-portal-acceptance-pullrequest(master)#4003 |
Same issue also seen at #636, so forwarding manually! |
Forwarded at brianchandotcom#97047 |
And #632 → brianchandotcom#97050 |
Reviewed. Test failures are unrelated. ✔️ Confirmed issue already exists in upstream: https://liferay.spiraservice.net/16/TestCase/191632.aspx |
From the commit itself:
The effect can be seen in this screencast and it happened to all tooltips in DXP:
The Problem
To take over the native tooltips, we move
title
attributes todata-restore-title
when we enter a trigger element. This attribute is then restored back totitle
when we abandon it.Previous logic depended on a
useEffect(... [target])
and some internal conditions to execute thesaveTitle
method whilerestoreTitle
was running unconditionally when the trigger was abandoned (like to move into the tooltip).The Fix
We simply move the
saveTitle
execution to the initial show trigger. This means there are more DOM changes but the DOM state remains consistent through interactions.Test Plan
Additional Reference
Just because I've kept this around all this time, in case someone goes into the implementation and wonders what's with all the craziness... this is the tooltip state diagram: