Vanishing titles - #1351
Conversation
|
|
||
| if(gd._context.editable) { | ||
| if(!txt) setPlaceholder(); | ||
| else el.on('.opacity', null); |
There was a problem hiding this comment.
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.
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.
@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.
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