calcite-design-system
calcite-design-system copied to clipboard
Respect hidden attribute added by end users on components
Check existing issues
- [X] I have checked for existing issues to avoid duplicates
Actual Behavior
Some components toggle the hidden attribute which will override any user set hidden attribute on a component.
Expected Behavior
User added hidden attributes are respected on a component
Reproduction Sample
N/A Multiple components affected
Reproduction Steps
- See following components usage below
Reproduction Version
2.2.0
Relevant Info
src/components/combobox/combobox.tsx:
1041 const hidden = !find(item, filteredData);
1042: item.hidden = hidden;
1043 const [parent, grandparent] = item.ancestors;
1045 if (find(parent, filteredData) || find(grandparent, filteredData)) {
1046: item.hidden = false;
1047 }
1049 if (!hidden) {
1050: item.ancestors.forEach((ancestor) => (ancestor.hidden = false));
1051 }
src/components/flow/flow.tsx:
164 itemNode.showBackButton = itemNode === activeItem && newItemCount > 1;
165: itemNode.hidden = itemNode !== activeItem;
166 });
src/components/stepper/stepper.tsx:
412 if (index !== activePosition) {
413: item.hidden = true;
414 } else {
415: item.hidden = false;
416 item.multipleViewMode = false;
426 this.items.forEach((item: HTMLCalciteStepperItemElement) => {
427: item.hidden = false;
428 item.multipleViewMode = true;
src/components/table/table.tsx:
355 const inView = rowPos >= this.pageStartRow && rowPos < this.pageStartRow + this.pageSize;
356: row.hidden = this.pageSize > 0 && !inView && !this.footRows.includes(row);
357 row.lastVisibleRow =
src/components/tip-manager/tip-manager.tsx:
201 tip.selected = isSelected;
202: tip.hidden = !isSelected;
203 });
Regression?
No response
Priority impact
p2 - want for current milestone
Impact
No response
Calcite package
- [X] @esri/calcite-components
- [ ] @esri/calcite-components-angular
- [ ] @esri/calcite-components-react
- [ ] @esri/calcite-design-tokens
- [ ] @esri/eslint-plugin-calcite-components
Esri team
N/A
Per our triage session, this can be converted into an epic if we need to split up component updates.
For combobox.tsx, would the following be the correct logic when the hidden attribute is applied, regardless of the combobox logic to display/hide elements?
In other words, if the ancestor of an item has the "hidden" attribute, then the item is also hidden.
In other words, if the ancestor of an item has the "hidden" attribute, then the item is also hidden.
Yes, that is correct.