Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
107 stars 7 forks source link

Add a new property to the autocomplete component to enhance the nonJS functionality #657

Closed alexwbbr closed 2 weeks ago

alexwbbr commented 4 weeks ago

A new property needs to be added to the autocomplete component to better handle some nonJS scenarios. Currently by default if no javascript is detected it will fallback and render a select component with all of the available options, instead of this behaviour a new property needs to be added so that other html elements could be rendered instead.

Please make a new property called nonJsComponent which will take html as a value. If this property is detected and the component isn't hydrated (user has turned off JS) then render the nonJsComponent. If the user hasn't used the new property and the component isn't hydrated then continue it should fallback to the select component by default as we are doing currently.

Please follow these steps to create your branch:

git checkout release/1.1.0
git pull
git checkout -b 'feature/autocomplete-non-js-fallback'
daniele-zurico commented 3 weeks ago

pushed on feature/autocomplete-non-js-fallback the branch created was just to try to experiment with a possible solution (that seems to work as expected). It's missing:

daniele-zurico commented 2 weeks ago

closed by https://github.com/Capgemini/dcx-react-library/pull/661