-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve handling of $link widget's draggable="no" #9262
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
base: master
Are you sure you want to change the base?
Conversation
…dget's draggable attribute is set to no
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@bepuzzled It appears that this is your first contribution to the project, welcome. With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see contributing.md). |
📊 Build Size Comparison:
|
Branch | Size |
---|---|
Base (master) | 2537.6 KB |
PR | 2537.7 KB |
Diff: ⬆️ Increase: +0.1 KB
core/modules/widgets/link.js
Outdated
dragTiddlerFn: function() {return self.to;}, | ||
widget: this | ||
}); | ||
} else { |
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.
In TW we use tabs for indentation. So you need to convert the spaces.
There also needs to be an else if(this.draggable === "no")
otherwise any draggable parameter will add draggable=false
So draggable="noABC"
will also deactivate dragging
indentation changed from spaces to tabs modified else statement into a else if statement for additional specificity
Looks good to me now. |
bepuzzled has signed the Contributor License Agreement (see contributing.md) |
Thanks @bepuzzled. This will be merged soon when we start merging v5.4.0 PRs. |
This basic PR intends to improve browsers compliance with user's intent when the widget's
draggable
attribute is set tono
achieved by setting the resulting<a>
tag'sdraggable
attribute tofalse
.Currently, the user's desire to disable drag and drop when creating a
<$link
widget by specifying attributedraggable="no"
does not carry this intent in the resulting HTML<a
tag with a matchingdraggable="false"
attribute. Thus browsers still allow the user to drag the link.PR submitted following the discussion and screen captures at https://talk.tiddlywiki.org/t/question-regarding-the-link-widget-when-its-draggable-attribute-is-set-to-no/13319/4 and associated recommendation for a PR.