Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/material/chips/chip-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ export class MatChipGrid
* @docs-private
*/
@Input()
get placeholder(): string {
get placeholder(): string | null | undefined {
return this._chipInput ? this._chipInput.placeholder : this._placeholder;
}
set placeholder(value: string) {
set placeholder(value: string | null | undefined) {
this._placeholder = value;
this.stateChanges.next();
}
protected _placeholder = '';
protected _placeholder: string | null | undefined = '';

/** Whether any chips or the matChipInput inside of this chip-grid has focus. */
override get focused(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/material/chips/chip-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class MatChipInput implements MatChipTextControl, OnChanges, OnDestroy {
readonly chipEnd: EventEmitter<MatChipInputEvent> = new EventEmitter<MatChipInputEvent>();

/** The input's placeholder text. */
@Input() placeholder: string = '';
@Input() placeholder: string | null | undefined = '';

/** Unique id for the input. */
@Input() id: string = inject(_IdGenerator).getId('mat-mdc-chip-list-input-');
Expand Down
2 changes: 1 addition & 1 deletion src/material/chips/chip-text-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface MatChipTextControl {
id: string;

/** The text control's placeholder text. */
placeholder: string;
placeholder: string | null | undefined;

/** Whether the text control has browser focus. */
focused: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/material/form-field/form-field-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export abstract class MatFormFieldControl<T> {
readonly id!: string;

/** The placeholder for this control. */
readonly placeholder!: string;
readonly placeholder?: string | null;

/** Gets the AbstractControlDirective for this control. */
readonly ngControl: NgControl | AbstractControlDirective | null = null;
Expand All @@ -41,7 +41,7 @@ export abstract class MatFormFieldControl<T> {
readonly shouldLabelFloat: boolean = false;

/** Whether the control is required. */
readonly required: boolean = false;
readonly required?: boolean;

/** Whether the control is disabled. */
readonly disabled: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion src/material/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class MatInput
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
@Input() placeholder!: string;
@Input() placeholder: string | null | undefined;

/**
* Name of the input.
Expand Down
Loading