Skip to content

MultiComboBox : Pasting content does not trigger internal state change #8275

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

Closed
1 task done
CoderCatA5 opened this issue Feb 13, 2024 · 1 comment · Fixed by #8413
Closed
1 task done

MultiComboBox : Pasting content does not trigger internal state change #8275

CoderCatA5 opened this issue Feb 13, 2024 · 1 comment · Fixed by #8413
Assignees
Labels
bug This issue is a bug in the code Medium Prio TOPIC RL

Comments

@CoderCatA5
Copy link

CoderCatA5 commented Feb 13, 2024

Bug Description

  • Pasting content does not trigger the Filter Feature.
    • If a user triggers the onInput via typing . The items get filtered based on input .
    • However this is not the case when the user pastes the same string or a part of the string
    • eg. If the list of items ["Luck","LuckLuck","Item1","Item2","Object1","Object2"] and he starts typing in Luc , The items ["Luck","LuckLuck"] are filtered out. This is not consistent while pasting Luc.
  • Pasting content does not trigger state change
    • Incase a user adds a feature where he can add an element that does not exist in the list of items. He cannot paste some text and press enter.(My issue)
  • Pasting content twice does not paste twice. (because the state has not been changed)

Affected Component

MultiComboBox

Expected Behaviour

  • Pasting content should update the internal state
  • Lets say i paste Luck then i paste Lu i want LuckLu to be displayed in the input ### field.
    • Currently the Luck is replaced by Lu.
  • It should also filter the items accordingly.
  • Enter Key press should be registered as an event to implement this
    • Incase a user adds a feature where he can add an element that does not exist in the list of items. He cannot paste some text and press enter.(My issue)
    • If a user adds an element via paste that does not exist in the options. The he cant press enter and add it as a value . But if he adds a space after it . The Enter Key will fire an onChange input and the item is added . If the space is not added ,the Enter Key does not have a registered event . (Most likely because the internal state is not updated onPaste).

Isolated Example

https://stackblitz.com/edit/js-ykkom8?file=index.html

Steps to Reproduce

  1. Vist the StackBlitz at Link
  2. Have Luck in your clipboard
  3. Paste it in the MultiComboBox - Notice it does not filter out the items and give an output
  4. Paste again - The value LuckLuck is not displayed.
  5. This behavior is present on Storybook. When allowCustomValues is set to true

Log Output, Stack Trace or Screenshots

ui-5.paste.mp4

Priority

High

UI5 Web Components Version

1.22.1

Browser

Chrome

Operating System

Windows

Additional Context

No response

Organization

SAP Labs India

Declaration

  • I’m not disclosing any internal or sensitive information.
@CoderCatA5 CoderCatA5 added the bug This issue is a bug in the code label Feb 13, 2024
@ivoplashkov ivoplashkov self-assigned this Feb 13, 2024
@ivoplashkov ivoplashkov removed their assignment Feb 14, 2024
@ivoplashkov
Copy link
Member

Hello colleagues,

The issue is reproduced as described by the reporter, it can also be reproduced in our test page.
I don' t think this has been implemented yet, as we only have logic for tokenizing the value if pasted from a spreadsheet. I couldn't find a clear interaction guidelines on how exactly should the component behave upon pasting, but in UI5, once the value is pasted, the popover is opened and the suggestions are filtered as expected by the reporter.

Could you please have a look?
Best regards,
Ivaylo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code Medium Prio TOPIC RL
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants