Skip to content
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

[Input]: [Cannot enter space or Enter when the Input is rendered within the Tree] #7566

Closed
1 task done
jamesPodo opened this issue Sep 8, 2023 · 4 comments · Fixed by #8637
Closed
1 task done
Assignees
Labels
bug This issue is a bug in the code consulting Medium Prio TOPIC P

Comments

@jamesPodo
Copy link

Describe the bug

cannot type space on input field when the Input is rendered in Tree.
There was a similar issue on Header Input with List.
#4049
Could you please fix the issue? Thank you!

Isolated Example

No response

Reproduction steps

...

Expected Behaviour

No response

Screenshots or Videos

No response

UI5 Web Components for React Version

1.16.0

UI5 Web Components Version

1.14.0

Browser

Chrome

Operating System

Mac

Additional Context

No response

Relevant log output

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@jamesPodo jamesPodo added the bug This issue is a bug in the code label Sep 8, 2023
@Lukas742
Copy link
Collaborator

Hi @jamesPodo

you have to prevent the keydown event from bubbling up to the Tree/TreeItemCustom. (See here)

I'm not sure if this should be handled by the component itself (since propagation is standard JS event behavior), so I'm transferring this issue to the ui5-webcomponents repo, as the affected components are developed there.


Hi colleagues,
could you please take a look at this issue? You can find a codeSandbox using ui5wc without our wrapper here.

@Lukas742 Lukas742 transferred this issue from SAP/ui5-webcomponents-react Sep 11, 2023
@NHristov-sap
Copy link
Contributor

Hello @ui5-webcomponents-topic-rl,
I am forwarding this issue to you as the reported issue is reproducible. There is solution proposal by @Lukas742 , but please check if this can be done in the component itself.

Best Regards,
Nikolay Hristov

@jamesPodo
Copy link
Author

Hi, the workaround worked for me, but I wonder if this is expected behaviour when the input is rendered in tree list? because it seems the event is being not propagated due to keyboard supports in tree component. Thank you!

@elenastoyanovaa elenastoyanovaa removed their assignment Sep 18, 2023
@niyap niyap self-assigned this Oct 26, 2023
@niyap
Copy link
Contributor

niyap commented Nov 27, 2023

Hello @SAP/ui5-webcomponents-topic-p,

The issue is caused by the ListItem which is inherited by the TreeItem. If you look at the _onkeydown method of the component, e.preventDefault(); is called both on SPACE and ENTER key.

The issue could be easily reproduced in the CodeSandbox provided, as well as if you enhance the ui5-tree test page by adding a input field within a custom item.

Similar issue: #4049

Could you please look over?

Kind Regards,
Niya

@niyap niyap added TOPIC P and removed TOPIC RL labels Nov 27, 2023
@niyap niyap removed their assignment Jan 9, 2024
@plamenivanov91 plamenivanov91 self-assigned this Apr 4, 2024
plamenivanov91 added a commit to plamenivanov91/ui5-webcomponents that referenced this issue Apr 4, 2024
Some components which extend the ListItem (TreeItemBase) need Space key
not to be prevented in order to allow space functionality in some of
their nested components.

Fixes: SAP#7566
plamenivanov91 added a commit that referenced this issue Apr 11, 2024
Previously it was impossible to properly use keyboard inside input elements nested in TreeItemCustom. Now the handling is similar to CustomListItem and input elements can be used as expected.

Fixes: #7566
plamenivanov91 added a commit that referenced this issue Apr 17, 2024
Previously it was impossible to properly use keyboard inside input elements nested in TreeItemCustom. Now the handling is similar to CustomListItem and input elements can be used as expected.

Fixes: #7566
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 consulting Medium Prio TOPIC P
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

6 participants