-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add keystroke for fullscreen mode #18048
Add keystroke for fullscreen mode #18048
Conversation
5c81c22
to
3a1dd7a
Compare
1858615
to
fd526c8
Compare
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.
After using the keystroke, it seems like browser steal the focus and the second stroke doesn't toggle editor fullscreen but is handled by the browser. We should add an editor.editing.view.focus();
call either here to the keystroke handler, or directly in the command (I think it makes sense - but then remember to remove this call from button press in UI plugin).
this.editor.accessibility.addKeystrokeInfos( { | ||
keystrokes: [ | ||
{ | ||
label: t( 'Fullscreen mode' ), |
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.
const t = this.editor.locale.t; | ||
|
||
// Set the Ctrl+Shift+F keystroke. | ||
this.editor.keystrokes.set( 'Ctrl+Shift+F', FULLSCREEN ); |
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 see we use such convention in some places (e.g. for bold
plugin) but it's only useful if such const can be used in multiple places. Here we can use fullscreen
as a command name directly. Or if we want to have it as a const, then also use it in line 47
where we add the command to the editor.
e2e313b
to
32b96a2
Compare
Suggested merge commit message (convention)
Internal: Add keystroke for fullscreen mode.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.