Skip to content

Commit

Permalink
Fix/draggable only when can drag (#3187)
Browse files Browse the repository at this point in the history
* check monitor for draggable

* versioning strategy with patch on changed repo and declined on all others

* fix: use string type for setting html attribute

* fix: always set the draggable attribute on connectDragSource

* fix: update semver doc

Co-authored-by: Chris Trevino <chtrevin@microsoft.com>
  • Loading branch information
seamuslowry and darthtrevino committed Feb 3, 2022
1 parent 83cc7fe commit 9126544
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .yarn/versions/cc76e3dc.yml
@@ -0,0 +1,7 @@
releases:
react-dnd-html5-backend: patch

declined:
- react-dnd-documentation
- react-dnd-examples
- react-dnd-test-utils
2 changes: 1 addition & 1 deletion packages/backend-html5/src/HTML5BackendImpl.ts
Expand Up @@ -149,7 +149,7 @@ export class HTML5BackendImpl implements Backend {
const handleDragStart = (e: any) => this.handleDragStart(e, sourceId)
const handleSelectStart = (e: any) => this.handleSelectStart(e)

node.setAttribute('draggable', 'true')
node.setAttribute('draggable', '' + this.monitor.canDragSource(sourceId))
node.addEventListener('dragstart', handleDragStart)
node.addEventListener('selectstart', handleSelectStart)

Expand Down

0 comments on commit 9126544

Please sign in to comment.