-
Notifications
You must be signed in to change notification settings - Fork 949
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
Add tooltip attribute to description widgets #1864 #2070
Conversation
@@ -65,14 +67,19 @@ class DescriptionView extends DOMWidgetView { | |||
|
|||
updateDescription() { | |||
let description = this.model.get('description'); | |||
let tooltip = this.model.get('tooltip'); | |||
if (tooltip.length === 0) { | |||
tooltip = description; |
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.
How would we disable the tooltip if we didn't want it to show up?
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.
As far as I understand, it couldn't be disabled completely previously also since it always defaults to the description. Not specifying the tooltip or setting it to an empty string will result in closest behavior.
Thanks! One design comment about disabling the tooltip if we'd like. Setting the tooltip to I agree that this change is strictly better than what we have (we can't turn off tooltips right now either). |
Also, can we call it |
Thanks for the feedback.
Just so that I understand correctly, the new behavior should be,
with |
Does that make sense to you as a user? It's a bit awkward that we use "None" as a default value, but it is a convention. The way I see it, if you have a string, set the tooltip to that (including |
I think it makes sense, looks great
(from mobile phone)
…On Thu, 10 May 2018, 22:54 Jason Grout, ***@***.***> wrote:
Does that make sense to you as a user? It's a bit awkward that we use
"None" as a default value, but it is a convention. The way I see it, if you
have a string, set the tooltip to that (including ''). If you have None,
do the default behavior.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2070 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABryPRE7wN_4mCRb_L0sXqRDxTxf0j3hks5txKkIgaJpZM4T6SkB>
.
|
If widget.description_tooltip is set to a string(including empty string), the tooltip is set to that. If it is set as None, use description string as default value.
That does make sense. I made the discussed changes. |
Thanks. We'll need to update the spec to have this trait, then I think we are good to merge. I'll look at this hopefully tomorrow. |
@SylvainCorlay - what are your thoughts about the model change here? In particular, the attribute can be either null or a string - does that make things difficult for xwidgets? |
Hey @jasongrout thanks for the heads up. The model changes are fine with me. We handle optional widget attributes very well in xwidgets. For example, in the layout widget, we do:
|
Great, then I'm okay with merging this for the beta. |
Thanks @piyushrungta25 for pushing this through! |
for #1864