fix(datetime): time wheel input mode is dismissed on user scroll (#26567)

This commit is contained in:
Liam DeBeasi
2023-01-06 12:08:38 -05:00
committed by GitHub
parent dd71a3b5f3
commit d13a14658d
3 changed files with 73 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import type { ComponentInterface, EventEmitter } from '@stencil/core';
import { Component, Element, Event, Listen, Host, h } from '@stencil/core';
import { Component, Element, Event, Listen, Method, Host, h } from '@stencil/core';
import { getElementRoot } from '../../utils/helpers';
@ -273,7 +273,14 @@ export class PickerInternal implements ComponentInterface {
this.emitInputModeChange();
};
private exitInputMode = () => {
/**
* @internal
* Exits text entry mode for the picker
* This method blurs the hidden input
* and cause the keyboard to dismiss.
*/
@Method()
async exitInputMode() {
const { inputEl, useInputMode } = this;
if (!useInputMode || !inputEl) {
return;
@ -290,7 +297,7 @@ export class PickerInternal implements ComponentInterface {
}
this.emitInputModeChange();
};
}
private onKeyPress = (ev: KeyboardEvent) => {
const { inputEl } = this;