axa-ch-webhub-cloud / pattern-library

AXA CH UI component library. Please share, comment, create issues and work with us!
https://axa-ch-webhub-cloud.github.io/plib-feature/develop
125 stars 18 forks source link

Datepicker dropdown let's you choose the default value of "Choose month" and "Choose year" #2416

Closed amir-ag closed 1 year ago

amir-ag commented 1 year ago

Please only report technical bugs. Clarify design issues in the slack channel #ux-ui-support.

A user can select the default values of "Choose month" and "Choose year". When one of these values is selected, a type error stating "Cannot read properties of undefined (reading 'name')" is thrown.

Expected Behavior

The default values of "Choose month" and "Choose year" shouldn't be options to available to select.

Current Behavior

A user can select the default values of "Choose month" and "Choose year"

Steps to Reproduce

Codesandbox

  1. Click on one of the two dropdowns and select "Choose month" and "Choose year".
  2. A type error is thrown.

Possible Solution

Remove default values from selectable options.

markus-walther commented 1 year ago

This is most likely a consequence of this 1-character typo in axa-dropdown: _disable instead of _disabled, cf. https://github.com/axa-ch-webhub-cloud/pattern-library/blob/develop/src/components/20-molecules/dropdown/index.js#L98

markus-walther commented 1 year ago

Note that the bug appears if the mobile view is triggered, e.g. on smaller screen widths, forcing the native <select> of the embedded dropdowns to be used.

Thus, testing that the bug is fixed must be done primarily on smaller screen widths.

markus-walther commented 1 year ago

This is tracked on https://jira.axa.com/jira/browse/WEBHUB-2210 as well.