diff --git a/CHANGELOG.md b/CHANGELOG.md index d890cb932..3e1815cdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ origin - **#2175** Addressed some rendering issues with Safar where a fraction inside a `\left...\right` was vertically offset. - **#2176** Using the `[hide-keyboard]` virtual keycap would cause a runtime error. +- **#2161** When the virtual keyboard is hidden, a `geometrychange` event is + dispatched. ## 0.96.0 (2023-11-14) diff --git a/src/virtual-keyboard/virtual-keyboard.ts b/src/virtual-keyboard/virtual-keyboard.ts index 97cfd28d7..01ed009a6 100644 --- a/src/virtual-keyboard/virtual-keyboard.ts +++ b/src/virtual-keyboard/virtual-keyboard.ts @@ -778,9 +778,12 @@ export class VirtualKeyboard implements VirtualKeyboardInterface, EventTarget { stateChanged(): void { this.dispatchEvent(new Event('virtual-keyboard-toggle')); - this.sendMessage('geometry-changed', { - boundingRect: this.boundingRect, - }); + if (!this._visible) { + this.dispatchEvent(new Event('geometrychange')); + this.sendMessage('geometry-changed', { + boundingRect: this.boundingRect, + }); + } } /**