tegel icon indicating copy to clipboard operation
tegel copied to clipboard

[Bug report]: Tds-dropdown ( multiselect ) component with filter shows no results when at least one item selected

Open sapostol opened this issue 6 months ago • 0 comments

Requirements before reporting

  • [X] No duplicated issue reported.
  • [X] I have checked the latest version if the bug exist there. See all available packages at npmJS.com
  • [X] I have followed the installation guide.

Package versions

"@scania/tegel-react": "1.13.0"

Browser

Chrome

Framework

React

Version

"react": "18.2.0"

Reproduction steps

  1. Add component Tds-Dropdown with multiselect and filter (list op options: option 1, option 2, option 3, option 4)
  2. Click on the dropdown and select option 1 and option 2
  3. Click again on the dropdown label and type "op"
  4. You will see now the "No results" message as I think it tries to search for the entire value of the multiselect at this moment, meaning that instead of just searching for "op" through the options, it searches for "option 1, option 2, op"

Code example

<TdsDropdown name='connectedEquipments' multiselect filter modeVariant='secondary' size='md' placeholder='Select equipments' label='Associate equipments' label-position='outside' noResultText='No results' openDirection='up' default-value={['option4']}

       <TdsDropdownOption value='option1'>
            Option 1
        </TdsDropdownOption>
       <TdsDropdownOption value='option2'>
            Option 2
        </TdsDropdownOption>
       <TdsDropdownOption value='option3'>
            Option 3
        </TdsDropdownOption>
       <TdsDropdownOption value='option4'>
            Option 4
        </TdsDropdownOption>      

Screenshots

Add/Copy screenshot here tdsDropdownIssue

Expected behaviour

Component Tds dropdown with multiselect and filter should only search for the last string typed after the last comma, if any option selected, not for the entire value

Console errors

Add warning/error message

Contact information

[email protected]

sapostol avatar Sep 03 '24 07:09 sapostol