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

[ui5-tree/ui5-tree-item] - Add a SelectionMode attribute : just on checkbox or the entire item #4502

Closed
1 of 3 tasks
lucianiz opened this issue Dec 17, 2021 · 2 comments
Closed
1 of 3 tasks

Comments

@lucianiz
Copy link

lucianiz commented Dec 17, 2021

Feature Request Description

We have a use case where we need to display hierarchically structured data with the option to select (MultiSelect) but the selection of an item and clicking on an item need to be disconnected. Clicking on the item displays additional information about the item and the selection is used to mark multiple items for various actions.

The depth can be more than 3 levels deep but the standard data entry usually has 3.

In summary what we need is that when a user clicks on the element but not on the checkbox, the checkbox should not be selected,
image

When clicking on the checkbox directly, the checkbox should be marked:
image

I've noticed that currently the cursor changes when hovering over the checkbox as opposed to the rest of the tree-item.

Proposed Solution

Have an additional attribute called SelectionMode with values "Item"(default) or "Checkbox".

There should also be another event added to distinguish between clicking on the Item or clicking on the Checkbox.

Proposed Alternatives

Another option would be to add another value to the Mode attribute, called "MultiSelectCheckbox" (or something like that)

I think the first option might be better since it could also be applied for the SingleSelect mode.

Additional Context

Add other context or screenshots related to the feature request here.

Priority

  • Low
  • Medium
  • [x ] High
  • Very High

A clear and concise description of the impact/urgency of the required feature.

Stakeholder Info (if applicable)

  • Organization: rit-edv consulting
  • Bussiness impact: This is currently blocking for us, we can try to make a workaround using ui5-list but it's a bit redundant since we need to display hierarchical data we need to convert the ui5-list into a tree so that would be basically almost re-implementation of the current ui5-tree .
@PetyaMarkovaBogdanova
Copy link
Contributor

Hi team,
can you, please, consider if the described desired functionality is applicable for ui5-tree-item?

Kind regards,
Petya Markova.
(UI5 Web Components Dispatcher)

@PetyaMarkovaBogdanova PetyaMarkovaBogdanova removed their assignment Dec 17, 2021
eswortmaler pushed a commit to eswortmaler/ui5-webcomponents that referenced this issue Dec 28, 2021
When using the ui5-list or ui5-tree with mode MultiSelect,
SingleSelectEnd, or SingleSelectBegin it is sometimes undesireable
for a click on an item to always trigger a selection change. An example
use case would be a multi select tree where clicking the checkbox
changes the selection, but clicking the item displays more information.
We introduce a noClickSelect property on ui5-list and ui5-tree that
enables this behaviour.

Fixes SAP#4502
eswortmaler added a commit to eswortmaler/ui5-webcomponents that referenced this issue Dec 28, 2021
When using the ui5-list or ui5-tree with mode MultiSelect,
SingleSelectEnd, or SingleSelectBegin it is sometimes undesirable
for a click on an item to always trigger a selection change. An example
use case would be a multi select tree where clicking the checkbox
changes the selection, but clicking the item displays more information.
We introduce a noClickSelect property on ui5-list and ui5-tree that
enables this behavior.

Fixes SAP#4502
ilhan007 pushed a commit that referenced this issue Feb 8, 2022
Add the preventable behaviour of the item-click event to the Tree
component too.

Related to: #4502
@nnaydenow
Copy link
Contributor

Hi @lucianiz,

With #4708 we extended item-click event and now it can be prevented to execute default behavior (selection). If you have SingleSelect / MultiSelect mode it better to listen for selection-change event if you want to observe change in selected list items.

You can check this snippix to see how it works now:
https://codesandbox.io/s/ui5-webcomponents-forked-6i2n0k?file=/index.html

Regards,
Nayden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
3 participants