Remove enableUserSelectHack, set to false by default
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start with lib/DraggableCore.js around line 97 and lib/utils/domFns.js around line 168 to understand how enableUserSelectHack is defined and consumed. Done means the hack is removed or defaults to false without clearing the user's document selection; verify the Gmail compose reproduction described in the issue.
Written by the indexing model from the issue text.
Description
Rant: We had an incredibly difficult time connecting the dots between a setState causing a modal to hide and figuring out why the user was losing focus in Gmail. I've probably spent 10+ hours digging through our codebase since we have a ton of places where we manage the user's selection. The last thing I expected was for the Draggable wrapper on that modal to be removing all ranges from the document. I had to resort to a binary search "comment half of everything out, see if it still works, repeat" which was still extremely difficult because I didn't consider the very last element to be the one causing issues.
Repro: The user selects text in any Gmail compose window, opens formatting, clicks bold, our modal disappears (from something like document.addEventListener('mousedown', checkIsOutsideAndHideModal), and the user loses their selection and bold is not applied
RCA:
https://github.com/react-grid-layout/react-draggable/blob/master/lib/DraggableCore.js#L97
This comment explains why it exists, but the code that consumes this flag is mostly about removing document ranges
https://github.com/react-grid-layout/react-draggable/blob/master/lib/utils/domFns.js#L168
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-grid-layout/react-draggable
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
react-grid-layout/react-draggable#784 · 4 comments · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
react-grid-layout/react-draggable#782 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
react-grid-layout/react-draggable#781 · 1 comment · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
react-grid-layout/react-draggable#780 · 8 comments ·
All issues in react-grid-layout/react-draggable
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100