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

[List item] Child elements behavior can be toggled open without selection change and event dispatch #8515

Closed
2 of 6 tasks
geospatialem opened this issue Dec 28, 2023 · 8 comments
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. c-list Issues that pertain to the calcite-list component calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone need more info Issues that are missing information and/or a clear, actionable description. needs triage Planning workflow - pending design/dev review. p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@geospatialem
Copy link
Member

Check existing issues

Description

A way to opt in to an stripped-down behavior when clicking a list-item that contains nested list-items.

Originally posted in #6544, diverging the two separate functions - selection and filtering - for development efforts.

cc @nwhittaker

Acceptance Criteria

Clicking the content area of a list-item with nested list-items:

  • Toggle's the list-item's open property to show/hide the nested list-items.
  • Does not mark the list-item as selected and does not trigger its calciteListItemSelect event.
  • Does not deselect the previously selected list-item.
  • Clicking any of the list-item's actions does not toggle the open property.

Relevant Info

Originally posted in #6544, diverging the two separate functions - selection and filtering - for development efforts.

Which Component

list-item

Example Use Case

The Field Maps web app would like to use the calcite-list element to display the layers in a map. For group layers, nested layers are shown as child list-items.

Selecting a leaf layer navigates the app for further handling of the layer. However, the app does not provide further handling for group layers. They are treated more like folders that organize sets of layers -- so clicking them in the list should have no effect other than to drill down to leaf layers.

Priority impact

p2 - want for current milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Dec 28, 2023
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone calcite-components Issues specific to the @esri/calcite-components package. labels Dec 28, 2023
@geospatialem geospatialem added design Issues that need design consultation prior to development. p - medium Issue is non core or affecting less that 60% of people using the library labels Dec 28, 2023
@geospatialem
Copy link
Member Author

A figma resource was added via this comment and a follow-up comment to this Figma file:

image

@driskull
Copy link
Member

Toggle's the list-item's open property to show/hide the nested list-items.

The default action for a list item is selection. If selection-mode is "none" then we could open the nested list item if it has one if that is the request here.

Does not mark the list-item as selected and does not trigger its calciteListItemSelect event.

I think the selection-mode of "none" is what this is for.

Does not deselect the previously selected list-item.

I think the selection-mode of "none" is what this is for.

Clicking any of the list-item's actions does not toggle the open property.

This should already be the case.

@geospatialem geospatialem added the need more info Issues that are missing information and/or a clear, actionable description. label Dec 28, 2023
@ashetland
Copy link

I think some context was lost when this issue was split off from #6544. From this comment:

Selection modes
Final proposal for revising the existing single and multiple selection-modes and adding children and multichildren can be found in this Figma file. See also the image below. This would be consistent with changes to Tree in issue #6912 and pr #6926.

The idea was to flush out the selection modes for List to match those in Tree so there would be modes where the parent List Item could act more like a folder. In selection-mode="single | multiple" these parent List Items would not be selectable and the hit target for expanding or collapsing would be the entire item and not just the chevron. selection-mode="children | multichildren" would match the current behaviors of List. cc @nwhittaker @ade10176

Having said all that, it's possible we may need to revisit this strategy as part of our holistic design rethink related to #7100. cc @macandcheese @SkyeSeitz

@driskull
Copy link
Member

driskull commented Jan 2, 2024

The idea was to flush out the selection modes for List to match those in Tree so there would be modes where the parent List Item could act more like a folder.

I don't think we would need to add these additional modes if we just add expand/collapse support to list-item-groups since they don't have any selection. I prefer this to adding additional modes that complicate the UX.

We would need a design for this in order to proceed

@driskull
Copy link
Member

driskull commented Jan 2, 2024

The figma changes proposed would introduce breaking changes. We don't want to alter the way the current single or multiple selection works.

@nwhittaker
Copy link
Contributor

I don't think we would need to add these additional modes if we just add expand/collapse support to list-item-groups since they don't have any selection. I prefer this to adding additional modes that complicate the UX.

Agreed with this and we actually have an enhancement request for expanding/collapsing groups at #6537.

We would need a design for this in order to proceed

One design consideration is that we'd want to style top-level groups differently from nested groups. For example, the Layers and Rivers groups within this prototype.

@driskull
Copy link
Member

driskull commented Jan 2, 2024

Can we close this one in favor of #6537? We could triage it and get design started. cc @geospatialem

@ashetland ashetland added the c-list Issues that pertain to the calcite-list component label Jan 3, 2024
@geospatialem
Copy link
Member Author

Based on the discussion above - closing in favor of #6537, which will support the collapsing of list-item-groups comprised of list-items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. c-list Issues that pertain to the calcite-list component calcite-components Issues specific to the @esri/calcite-components package. design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone need more info Issues that are missing information and/or a clear, actionable description. needs triage Planning workflow - pending design/dev review. p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

4 participants