Skip to content

Wire up select all edit menu item to multi-select lists - #4509

Merged
shiftkey merged 7 commits into
masterfrom
select-all
Apr 24, 2018
Merged

shiftkey merged 7 commits into
masterfrom
select-all

Conversation

@niik

@niik niik commented Apr 23, 2018 •

Copy link
Copy Markdown
Member

Fixes #3821

This is a continuation of #4188 that wires up the "Select All" Edit menu item such that when keyboard focus resides within a List (which supports range or multi selection) the list deals with the event rather than the default electron action which selects all selectable text in the currently focused window.

We do this by moving the handling of the select-all menu item to the renderer and dispatching a custom DOM event to the element where keyboard focus currently resides and letting it bubble. Components then have the option to intercept that event and cancel the default action.

@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 23, 2018
@shiftkey

Copy link
Copy Markdown
Member

@niik this feels like it will close out #3821, right?

@niik

niik commented Apr 23, 2018 via email

Copy link
Copy Markdown
Member Author

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing, everything else is 💎

Comment thread app/src/ui/lib/list/list.tsx Outdated

this.list = element

if (element) {

This comment was marked as spam.

Comment thread app/src/ui/app.tsx
cancelable: true,
})

if (document.activeElement.dispatchEvent(event)) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@niik

niik commented Apr 24, 2018

Copy link
Copy Markdown
Member Author

🔩

@shiftkey
shiftkey merged commit 8f8d973 into master Apr 24, 2018
@shiftkey
shiftkey deleted the select-all branch April 24, 2018 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants