This is a migrated thread and some comments may be shown as answers.

ComboBox within TreeView

6 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Veteran
Bill asked on 04 Jun 2019, 05:28 PM

We have a ComboBox within a TreeView and the space bar doesn't work when attempting to type in the ComboBox input. I'm guessing it has to do with space  being used for checking a checkbox on the treeview (which I don't have enabled).

Is there a workaround for this?

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 05 Jun 2019, 08:01 AM
Hello, Bill,

Is it possible to share with us an example or at least the code used in this case?

Currently, the KendoReact does not have an official component representing ComboBox within TreeView, and I would like to see the code used to achieve the desired result. This will allow me to inspect it and make a suggestion best suited for it.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bill
Top achievements
Rank 1
Veteran
answered on 05 Jun 2019, 05:17 PM

Thanks for responding. Here is a quick rough sample of what I'm seeing. It isn't totally what we're doing but you should get the idea:

https://stackblitz.com/edit/react-p3fjwm

0
Stefan
Telerik team
answered on 06 Jun 2019, 10:24 AM
Hello, Bill,

Thank you for the example to illustrate the use case.

Indeed the TreeView is preventing the space click as it is reserved for a different functionality.

I was able to find an approach to still handle the space key press. The approach requires a custom event listener a programmatically setting the space on the correct position:

https://stackblitz.com/edit/react-p3fjwm-ng79nb?file=app/main.jsx

I hope that this approach will prove helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bill
Top achievements
Rank 1
Veteran
answered on 06 Jun 2019, 06:06 PM

Thanks that helps a lot. Now I'm running into issues with the other keyboard navigation, like using the up and down arrows to select within the dropdown. It might be the case where I need to use something besides the tree view for what I want to accomplish.

 

Thanks again for your help.

0
Accepted
Stefan
Telerik team
answered on 07 Jun 2019, 07:42 AM
Hello, Bill,

Than you for the additional details.

After more research we found that stopping the event propagation on the div that hold the ComboBox will prevent any of the TreeView keydown events and show not causing issues like this one:

https://stackblitz.com/edit/react-p3fjwm-xernph?file=app/main.jsx

If some of the TreeView keyboard navigation features have to be used, only call stopPropagation in some cases depending on a condition.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bill
Top achievements
Rank 1
Veteran
answered on 07 Jun 2019, 06:46 PM

This is pretty much exactly what I was trying to do. Sometimes the most obvious solutions are the ones that don't come to you.

 

Thanks for your help!

Tags
General Discussions
Asked by
Bill
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Bill
Top achievements
Rank 1
Veteran
Share this question
or