Skip to content

Commit

Permalink
docs(datetime): add best practices for setting value async (#3053)
Browse files Browse the repository at this point in the history
  • Loading branch information
averyjohnston authored Aug 23, 2023
1 parent dedf768 commit 6e7737e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ While seconds, milliseconds, and time zone can be specified using the ISO 8601 d

If you need to present a datetime in an overlay such as a modal or a popover, we recommend using [ion-datetime-button](./datetime-button). `ion-datetime-button` should be used when space is constrained. This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open in the overlay.

## Setting Values Asynchronously

If its `value` is updated programmatically after a datetime has already been created, the datetime will automatically jump to the new date. However, it is recommended to avoid updating the `value` in this way when users are able to interact with the datetime, as this could be disorienting for those currently trying to select a date. For example, if a datetime's `value` is loaded by an asyncronous process, it is recommended to hide the datetime with CSS until the value has finished updating.

## Date Constraints

### Max and Min Dates
Expand Down

0 comments on commit 6e7737e

Please sign in to comment.