-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Vanishing titles #1351
Vanishing titles #1351
Conversation
}); | ||
} | ||
|
||
if(gd._context.editable) { | ||
if(!txt) setPlaceholder(); | ||
else el.on('.opacity', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is just this line. All the rest is cleanup and testing :)
}, interactConstants.HIDE_PLACEHOLDER + 50); | ||
}, interactConstants.SHOW_PLACEHOLDER + 50); | ||
|
||
return promise; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. 🎉
If you're up for a challenge, you could try adding a test for title edits like I did here for legend/trace name edits.
💃 |
return new Promise(function(resolve) { | ||
gd.once('plotly_relayout', function(eventData) { | ||
expect(eventData[attr]).toEqual(text, [letter, attr, eventData]); | ||
setTimeout(resolve, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard nice editing tests in finance! And good call to include a test like that here too. The only thing I did differently is this: put resolve in a short setTimeout
instead of manually removing the node. Not sure why makeEditable
uses a duration-0 transition rather than just removing the element synchronously... but this seems to play well with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eyes on that 0-second transition 🔬
fixes https://github.com/plotly/streambed/issues/8961
The issue turned out to be entering a title again after deleting the default, the hover events for the placeholder text weren't cleared.
@chriddyp you had a comment that it involved annotations as well, but I don't see it, so I'm assuming maybe that part actually was https://github.com/plotly/streambed/issues/8423
cc @etpinard