Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/input-field/input-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { InputType } from '../input-field/input-field.types';
import { ListItem } from '../list/list-item.types';
import { getHref, getTarget, getRel } from '../../util/link-helper';
import { JSXBase } from '@stencil/core/internal';
import { JSXBase, Method } from '@stencil/core/internal';
import { createRandomString } from '../../util/random-string';
import { LimelListCustomEvent } from '../../components';
import { globalConfig } from '../../global/config';
Expand Down Expand Up @@ -55,7 +55,7 @@ const RESIZE_HANDLER_DEBOUNCE_TIMEOUT = 100;
*/
@Component({
tag: 'limel-input-field',
shadow: true,
shadow: { delegatesFocus: true },
styleUrl: 'input-field.scss',
})
export class InputField {
Expand Down Expand Up @@ -248,6 +248,11 @@ export class InputField {
@State()
public showCompletions: boolean = false;

@Method()
public async focus() {
this.mdcTextField?.focus();
}

private inputElement?: HTMLInputElement | HTMLTextAreaElement;
private mdcTextField: MDCTextField;
private completionsList: ListItem[] = [];
Expand Down
Loading