Skip to content

Commit

Permalink
fix: add missing isComposing KeyboardEvent property (#23996)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Jun 8, 2020
1 parent 36673bf commit e9427e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/web-contents.md
Expand Up @@ -366,6 +366,7 @@ Returns:
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
Expand Down
1 change: 1 addition & 0 deletions shell/common/gin_converters/content_converter.cc
Expand Up @@ -302,6 +302,7 @@ v8::Local<v8::Value> Converter<content::NativeWebKeyboardEvent>::ToV8(

using Modifiers = blink::WebInputEvent::Modifiers;
dict.Set("isAutoRepeat", (in.GetModifiers() & Modifiers::kIsAutoRepeat) != 0);
dict.Set("isComposing", (in.GetModifiers() & Modifiers::kIsComposing) != 0);
dict.Set("shift", (in.GetModifiers() & Modifiers::kShiftKey) != 0);
dict.Set("control", (in.GetModifiers() & Modifiers::kControlKey) != 0);
dict.Set("alt", (in.GetModifiers() & Modifiers::kAltKey) != 0);
Expand Down

0 comments on commit e9427e7

Please sign in to comment.