Skip to content

feat(GlDatepicker): add clear button

Peter Hegman requested to merge gl-datepicker-add-clear-button into master

What does this MR do?

Adds the showClearButton prop. When set to true a clear button will be added when the input has a value.

Based on this thread: gitlab#228680 (comment 410751468)

Does this MR meet the acceptance criteria?

Screenshots

With clear Without clear
Screen_Shot_2020-10-06_at_9.43.09_PM Screen_Shot_2020-10-06_at_9.43.30_PM

This MR also refactors the calendar trigger button to use an actual button component instead of a SVG. This allows the datepicker to be opened with the keyboard. Previously the trigger button was not focusable so there was no way to open the datepicker with the keyboard.

Before refactor After refactor
Screen_Shot_2020-10-06_at_9.46.24_PM Screen_Shot_2020-10-06_at_9.43.30_PM

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidlines.
  • If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • [-] If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • Added the ~"component:*" label(s) if applicable.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading