Skip to content

Commit

Permalink
Fix array proto types for select.ts (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen authored Oct 16, 2024
1 parent 4a48fec commit 75edeb8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mesop/components/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class SelectComponent {
@Input() style!: Style;
private _config!: SelectType;

selectedOptions: string[] = [];
private initialSelectOptions: string[] = [];
selectedOptions: readonly string[] = [];
private initialSelectOptions: readonly string[] = [];

constructor(private readonly channel: Channel) {}

Expand Down Expand Up @@ -87,10 +87,10 @@ export class SelectComponent {
return this.config().getAppearance() as 'fill' | 'outline';
}

private _checkInitialValuesChanged(values: string[]): boolean {
private _checkInitialValuesChanged(values: readonly string[]): boolean {
return (
JSON.stringify(this.initialSelectOptions.sort()) !==
JSON.stringify(values.sort())
JSON.stringify(this.initialSelectOptions.slice().sort()) !==
JSON.stringify(values.slice().sort())
);
}
}

0 comments on commit 75edeb8

Please sign in to comment.