-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with mat-autocomplete #109
Comments
Hi! Did you find any way to solve this issue ? Have the same... |
@ronan-guillamet Hi,
So, and then I listened field changes, send request and opened options manually after getting result. Simple example:
|
Currently, I solved it by calling @Injectable()
export class CustomKeyboardService extends MatKeyboardService {
public override openFromComponent(layoutOrLocale: string, config: MatKeyboardConfig): MatKeyboardRef<MatKeyboardComponent> {
const keyboardRef = super.openFromComponent(layoutOrLocale, config);
this.setClickEventPropagation(true);
const dismissFunction = keyboardRef.dismiss.bind(keyboardRef);
keyboardRef.dismiss = () => {
this.setClickEventPropagation(false);
dismissFunction();
}
return keyboardRef;
}
private setClickEventPropagation(enabled: boolean): void {
const action = (element: Element) => (enabled ? Element.prototype.addEventListener : Element.prototype.removeEventListener)
.call(element, 'click', Function.prototype.apply.bind(Event.prototype.stopPropagation));
Array.from(document.getElementsByClassName('mat-keyboard-wrapper'))
.forEach(action);
}
} You might want to track the |
Hello,
I use keyboard with mat-autocomplete field. But when I click keyboard buttons, autocomplete options won't appear
The text was updated successfully, but these errors were encountered: