Skip to content
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

feat(datepicker): add apply and cancel buttons #6638

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

keanan-meier
Copy link

@keanan-meier keanan-meier commented Feb 12, 2024

New feature description

This feature adds the option to enable an "Apply" and "Cancel" button to the datepicker. When enabled, the datepicker does not emit the change event from the view to the model until the value is applied by the new apply button. If the user chooses to cancel, the datepicker's value is reset back to the value of the model.

When this option is enabled it also keeps the datepicker open until the user applies, cancels, or dismisses the picker. This change improves the pickers behaviour when showTimePicker is also enabled as it allows the user to adjust both the date and time without the datepicker closing automatically after the date is updated. An issue discussed in #4203 .

The following new related config options have been added:

  • showApplyButton
  • showCancelButton
  • applyButtonLabel
  • cancelButtonLabel
  • applyPosition

The css has also been slightly tweaked to improve appearance when all buttons are enabled. (Today, Clear, Apply and Cancel).

PR Checklist

Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated tests.
  • added/updated API documentation.
  • added/updated demos.

Implement apply and cancel button to datepicker.
Modify behaviour to keep picker open until applied.

Related valor-software#4203
Add tests for new config options related to apply button
Adjusted doc wording
@keanan-meier keanan-meier marked this pull request as ready for review February 12, 2024 20:28
Fix issue where initial bsValue is not set correctly when show apply button is true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant