Skip to content

docs: account for this context #28720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 10 additions & 10 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ export namespace Components {
*/
"size": 'cover' | 'fixed';
/**
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days".
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"titleSelectedDatesFormatter"?: TitleSelectedDatesFormatter;
/**
Expand Down Expand Up @@ -1182,7 +1182,7 @@ export namespace Components {
*/
"counter": boolean;
/**
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength".
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"counterFormatter"?: (inputLength: number, maxLength: number) => string;
/**
Expand Down Expand Up @@ -1701,7 +1701,7 @@ export namespace Components {
*/
"breakpoints"?: number[];
/**
* Determines whether or not a modal can dismiss when calling the `dismiss` method. If the value is `true` or the value's function returns `true`, the modal will close when trying to dismiss. If the value is `false` or the value's function returns `false`, the modal will not close when trying to dismiss.
* Determines whether or not a modal can dismiss when calling the `dismiss` method. If the value is `true` or the value's function returns `true`, the modal will close when trying to dismiss. If the value is `false` or the value's function returns `false`, the modal will not close when trying to dismiss. Developers passing a function who wish to access "this" inside of the function should either use an arrow function or manually bind "this" using `.bind(this)` when passing the function to canDismiss.
*/
"canDismiss": boolean | ((data?: any, role?: string) => Promise<boolean>);
/**
Expand Down Expand Up @@ -2336,7 +2336,7 @@ export namespace Components {
*/
"pin": boolean;
/**
* A callback used to format the pin text. By default the pin text is set to `Math.round(value)`.
* A callback used to format the pin text. By default the pin text is set to `Math.round(value)`. See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"pinFormatter": PinFormatter;
/**
Expand Down Expand Up @@ -2974,7 +2974,7 @@ export namespace Components {
*/
"counter": boolean;
/**
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength".
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"counterFormatter"?: (inputLength: number, maxLength: number) => string;
/**
Expand Down Expand Up @@ -5646,7 +5646,7 @@ declare namespace LocalJSX {
*/
"size"?: 'cover' | 'fixed';
/**
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days".
* A callback used to format the header text that shows how many dates are selected. Only used if there are 0 or more than 1 selected (i.e. unused for exactly 1). By default, the header text is set to "numberOfDates days". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"titleSelectedDatesFormatter"?: TitleSelectedDatesFormatter;
/**
Expand Down Expand Up @@ -5897,7 +5897,7 @@ declare namespace LocalJSX {
*/
"counter"?: boolean;
/**
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength".
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"counterFormatter"?: (inputLength: number, maxLength: number) => string;
/**
Expand Down Expand Up @@ -6428,7 +6428,7 @@ declare namespace LocalJSX {
*/
"breakpoints"?: number[];
/**
* Determines whether or not a modal can dismiss when calling the `dismiss` method. If the value is `true` or the value's function returns `true`, the modal will close when trying to dismiss. If the value is `false` or the value's function returns `false`, the modal will not close when trying to dismiss.
* Determines whether or not a modal can dismiss when calling the `dismiss` method. If the value is `true` or the value's function returns `true`, the modal will close when trying to dismiss. If the value is `false` or the value's function returns `false`, the modal will not close when trying to dismiss. Developers passing a function who wish to access "this" inside of the function should either use an arrow function or manually bind "this" using `.bind(this)` when passing the function to canDismiss.
*/
"canDismiss"?: boolean | ((data?: any, role?: string) => Promise<boolean>);
/**
Expand Down Expand Up @@ -7060,7 +7060,7 @@ declare namespace LocalJSX {
*/
"pin"?: boolean;
/**
* A callback used to format the pin text. By default the pin text is set to `Math.round(value)`.
* A callback used to format the pin text. By default the pin text is set to `Math.round(value)`. See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"pinFormatter"?: PinFormatter;
/**
Expand Down Expand Up @@ -7750,7 +7750,7 @@ declare namespace LocalJSX {
*/
"counter"?: boolean;
/**
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength".
* A callback used to format the counter text. By default the counter text is set to "itemLength / maxLength". See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this if you need to access `this` from within the callback.
*/
"counterFormatter"?: (inputLength: number, maxLength: number) => string;
/**
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ export class Datetime implements ComponentInterface {
* dates are selected. Only used if there are 0 or more than 1
* selected (i.e. unused for exactly 1). By default, the header
* text is set to "numberOfDates days".
*
* See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this
* if you need to access `this` from within the callback.
*/
@Prop() titleSelectedDatesFormatter?: TitleSelectedDatesFormatter;

Expand Down
3 changes: 3 additions & 0 deletions core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ export class Input implements ComponentInterface {
/**
* A callback used to format the counter text.
* By default the counter text is set to "itemLength / maxLength".
*
* See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this
* if you need to access `this` from within the callback.
*/
@Prop() counterFormatter?: (inputLength: number, maxLength: number) => string;

Expand Down
4 changes: 4 additions & 0 deletions core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ export class Modal implements ComponentInterface, OverlayInterface {
*
* If the value is `true` or the value's function returns `true`, the modal will close when trying to dismiss.
* If the value is `false` or the value's function returns `false`, the modal will not close when trying to dismiss.
*
* Developers passing a function who wish to access "this" inside of the function
* should either use an arrow function or manually bind "this"
* using `.bind(this)` when passing the function to canDismiss.
*/
@Prop() canDismiss: boolean | ((data?: any, role?: string) => Promise<boolean>) = true;

Expand Down
3 changes: 3 additions & 0 deletions core/src/components/range/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ export class Range implements ComponentInterface {
/**
* A callback used to format the pin text.
* By default the pin text is set to `Math.round(value)`.
*
* See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this
* if you need to access `this` from within the callback.
*/
@Prop() pinFormatter: PinFormatter = (value: number): number => Math.round(value);

Expand Down
3 changes: 3 additions & 0 deletions core/src/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ export class Textarea implements ComponentInterface {
/**
* A callback used to format the counter text.
* By default the counter text is set to "itemLength / maxLength".
*
* See https://ionicframework.com/docs/troubleshooting/runtime#accessing-this
* if you need to access `this` from within the callback.
*/
@Prop() counterFormatter?: (inputLength: number, maxLength: number) => string;

Expand Down