Skip to content
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

Merged
merged 4 commits into from
Feb 3, 2017
Merged

Vanishing titles #1351

merged 4 commits into from
Feb 3, 2017

Conversation

alexcjohnson
Copy link
Collaborator

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

});
}

if(gd._context.editable) {
if(!txt) setPlaceholder();
else el.on('.opacity', null);
Copy link
Collaborator Author

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;
Copy link
Contributor

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.

@etpinard etpinard added this to the 1.23.0 milestone Feb 2, 2017
@etpinard
Copy link
Contributor

etpinard commented Feb 2, 2017

💃

return new Promise(function(resolve) {
gd.once('plotly_relayout', function(eventData) {
expect(eventData[attr]).toEqual(text, [letter, attr, eventData]);
setTimeout(resolve, 10);
Copy link
Collaborator Author

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.

Copy link
Contributor

@etpinard etpinard Feb 2, 2017

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 🔬

@alexcjohnson alexcjohnson merged commit dc76217 into master Feb 3, 2017
@alexcjohnson alexcjohnson deleted the vanishing-titles branch February 3, 2017 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants