Skip to content

Commit

Permalink
text-field: Prevent internal input event from bubbling. fixed #334
Browse files Browse the repository at this point in the history
  • Loading branch information
zdhxiong committed Oct 23, 2024
1 parent ed2c054 commit 95308da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/mdui/src/components/text-field/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import '../icon.js';
import { style } from './style.js';
import type { FormControl } from '@mdui/jq/shared/form.js';
import type { ObserveResize } from '@mdui/shared/helpers/observeResize.js';
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
import type { CSSResultGroup, TemplateResult } from 'lit';
import type { Ref } from 'lit/directives/ref.js';

/**
Expand Down Expand Up @@ -838,7 +838,9 @@ export class TextField
event.stopPropagation();
}

private onInput() {
private onInput(event: InputEvent) {
event.stopPropagation();

this.value = this.inputRef.value!.value;
if (this.isTextarea) {
this.setTextareaHeight();
Expand Down

0 comments on commit 95308da

Please sign in to comment.