-
Notifications
You must be signed in to change notification settings - Fork 64
Remove DOM nonsense from selection logic #981
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
affba5e to
1237636
Compare
|
Integration tests report: appsharing.space |
4fbff38 to
a8ec9ac
Compare
packages/schema/src/model.ts
Outdated
| handleItemSelection( | ||
| type: SelectionType, | ||
| item: string, | ||
| event?: { ctrlKey: boolean; button: number }, | ||
| ): { [key: string]: ISelection } | null { |
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.
I would keep event-related things out of the model, and handle those in the view only:
| handleItemSelection( | |
| type: SelectionType, | |
| item: string, | |
| event?: { ctrlKey: boolean; button: number }, | |
| ): { [key: string]: ISelection } | null { | |
| set selection( | |
| newSelection: { [key: string]: ISelection } | null | |
| ) { | |
| this.localState?.selected?.value = newSelection; | |
| } | |
| get selection(): { [key: string]: ISelection } | null { | |
| return this._selection; | |
| } |
From the view that handles the event:
const currentSelection = model.selection;
if (ctrlKey) {
model.selection = {...currentSelection, newItem}
}|
Hey Greg, would you mind updating the PR description to include a bit more information about the motivation for this change, and the title to be a bit more specific? 🙇 |
92497b8 to
664ee2b
Compare
martinRenou
left a comment
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.
Thanks!
Description
Resolve #910
Remove DOM related stuff from layer selection, allow setting selection programmatically
Checklist
Resolves #XXX.Failing lint checks can be resolved with:
pre-commit run --all-filesjlpm run lint📚 Documentation preview: https://jupytergis--981.org.readthedocs.build/en/981/
💡 JupyterLite preview: https://jupytergis--981.org.readthedocs.build/en/981/lite