Skip to content

Commit 2816b87

Browse files
authored
refactor(input): remove accept property (#28946)
BREAKING CHANGE: The `accept` property has been removed from `ion-input`.
1 parent a393d2a commit 2816b87

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

BREAKING.md

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ This allows components to inherit the color properly when used outside of Ionic
138138
<h4 id="version-8x-input">Input</h4>
139139

140140
- `size` has been removed from the `ion-input` component. Developers should use CSS to specify the visible width of the input.
141+
- `accept` has been removed from the `ion-input` component. This was previously used in conjunction with the `type="file"`. However, the `file` value for `type` is not a valid value in Ionic Framework.
141142

142143
<h4 id="version-8x-nav">Nav</h4>
143144

core/api.txt

-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ ion-infinite-scroll-content,prop,loadingSpinner,"bubbles" | "circles" | "circula
547547
ion-infinite-scroll-content,prop,loadingText,IonicSafeString | string | undefined,undefined,false,false
548548

549549
ion-input,scoped
550-
ion-input,prop,accept,string | undefined,undefined,false,false
551550
ion-input,prop,autocapitalize,string,'off',false,false
552551
ion-input,prop,autocomplete,"name" | "email" | "tel" | "url" | "on" | "off" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo",'off',false,false
553552
ion-input,prop,autocorrect,"off" | "on",'off',false,false

core/src/components.d.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,6 @@ export namespace Components {
11441144
"loadingText"?: string | IonicSafeString;
11451145
}
11461146
interface IonInput {
1147-
/**
1148-
* This attribute is ignored.
1149-
* @deprecated
1150-
*/
1151-
"accept"?: string;
11521147
/**
11531148
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
11541149
*/
@@ -5888,11 +5883,6 @@ declare namespace LocalJSX {
58885883
"loadingText"?: string | IonicSafeString;
58895884
}
58905885
interface IonInput {
5891-
/**
5892-
* This attribute is ignored.
5893-
* @deprecated
5894-
*/
5895-
"accept"?: string;
58965886
/**
58975887
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
58985888
*/

core/src/components/input/input.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ export class Input implements ComponentInterface {
7474
*/
7575
@Prop({ reflect: true }) color?: Color;
7676

77-
/**
78-
* This attribute is ignored.
79-
* @deprecated
80-
*/
81-
@Prop() accept?: string;
82-
8377
/**
8478
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
8579
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
@@ -784,7 +778,6 @@ export class Input implements ComponentInterface {
784778
ref={(input) => (this.nativeInput = input)}
785779
id={inputId}
786780
disabled={disabled}
787-
accept={this.accept}
788781
autoCapitalize={this.autocapitalize}
789782
autoComplete={this.autocomplete}
790783
autoCorrect={this.autocorrect}
@@ -892,7 +885,6 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
892885
ref={(input) => (this.nativeInput = input)}
893886
aria-labelledby={label ? label.id : null}
894887
disabled={this.disabled}
895-
accept={this.accept}
896888
autoCapitalize={this.autocapitalize}
897889
autoComplete={this.autocomplete}
898890
autoCorrect={this.autocorrect}

packages/angular/src/directives/proxies.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -955,15 +955,15 @@ export declare interface IonInfiniteScrollContent extends Components.IonInfinite
955955

956956

957957
@ProxyCmp({
958-
inputs: ['accept', 'autocapitalize', 'autocomplete', 'autocorrect', 'autofocus', 'clearInput', 'clearOnEdit', 'color', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'max', 'maxlength', 'min', 'minlength', 'mode', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'shape', 'spellcheck', 'step', 'type', 'value'],
958+
inputs: ['autocapitalize', 'autocomplete', 'autocorrect', 'autofocus', 'clearInput', 'clearOnEdit', 'color', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'max', 'maxlength', 'min', 'minlength', 'mode', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'shape', 'spellcheck', 'step', 'type', 'value'],
959959
methods: ['setFocus', 'getInputElement']
960960
})
961961
@Component({
962962
selector: 'ion-input',
963963
changeDetection: ChangeDetectionStrategy.OnPush,
964964
template: '<ng-content></ng-content>',
965965
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
966-
inputs: ['accept', 'autocapitalize', 'autocomplete', 'autocorrect', 'autofocus', 'clearInput', 'clearOnEdit', 'color', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'max', 'maxlength', 'min', 'minlength', 'mode', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'shape', 'spellcheck', 'step', 'type', 'value'],
966+
inputs: ['autocapitalize', 'autocomplete', 'autocorrect', 'autofocus', 'clearInput', 'clearOnEdit', 'color', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'max', 'maxlength', 'min', 'minlength', 'mode', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'shape', 'spellcheck', 'step', 'type', 'value'],
967967
})
968968
export class IonInput {
969969
protected el: HTMLElement;

packages/vue/src/proxies.ts

-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ export const IonInfiniteScrollContent = /*@__PURE__*/ defineContainer<JSX.IonInf
397397

398398
export const IonInput = /*@__PURE__*/ defineContainer<JSX.IonInput, JSX.IonInput["value"]>('ion-input', defineIonInput, [
399399
'color',
400-
'accept',
401400
'autocapitalize',
402401
'autocomplete',
403402
'autocorrect',

0 commit comments

Comments
 (0)