-
Notifications
You must be signed in to change notification settings - Fork 760
fix: allow select on table cells #5565
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
i think this is a lesser of two-evils option for now. something we can consider is if the current drag selects more than 1 cells (i.e. once its more than 1), clear the selection: // from https://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
} |
|
Thanks, I added the atom to check the state and func to clear the selection. I think its a good middle ground (perf and UX) |
| const isSelectingMultipleCells = useAtomValue(isSelectingMultipleCellsAtom); | ||
|
|
||
| if (isSelectingMultipleCells && window.getSelection) { | ||
| window.getSelection()?.empty(); |
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.
can we put this in the reducer? this may mean if you select somewhere else in the page and this re-renders for whatever reason, then the selection is cleared.
it would be better to do this in the reducer once we select more.
this could be in each action, or you can potentially use the reducer middleware
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.
that's awesome, didn't think it would be possible, but since the window is global, it makes sense.
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.14.11-dev23 |
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR fixes any issues, list them here by number (e.g., Fixes marimo-team#123). --> https://github.com/user-attachments/assets/92337c8d-1250-4bc1-92b4-e3291f3fae5b ## 🔍 Description of Changes <!-- Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] I have added tests for the changes made. - [ ] I have run the code and verified that it works as expected. ## 📜 Reviewers <!-- Tag potential reviewers from the community or maintainers who might be interested in reviewing this pull request. Your PR will be reviewed more quickly if you can figure out the right person to tag with @ @mscolnick (General, AI) @dmadisetti (Runtime, Caching, Fileformat, AST) @manzt (Widgets, Dependency Management, LSP) @Light2Dark (Tables, Plots, Layouts, SQL) @akshayka (Public API, Dependencies, UX/Styling, Backend, Docs, Integrations) -->
📝 Summary
CleanShot.2025-07-08.at.10.58.04.mp4
🔍 Description of Changes
📋 Checklist
📜 Reviewers