From bdea1f491f47ed80a0d774478d90bfa4361b389c Mon Sep 17 00:00:00 2001 From: Martynas Strazdas <43886789+MartynasStrazdas@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:33:10 +0200 Subject: [PATCH 1/3] Filter button visibility fix --- .../itwinui/TreeNodeRenderer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx index d0244c890..2035e259b 100644 --- a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx +++ b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx @@ -101,6 +101,9 @@ export const TreeNodeRenderer: React.ForwardRefExoticComponent { expandNode(node.id, isExpanded); }} + expanderProps={{ + onMouseDown: (e) => e.preventDefault(), + }} icon={getIcon ? getIcon(node) : undefined} label={getLabel ? getLabel(node) : node.label} sublabel={getSublabel ? getSublabel(node) : undefined} From 6342c2bc2a6f451fc5610725a332a8f009fb2b74 Mon Sep 17 00:00:00 2001 From: Martynas Strazdas <43886789+MartynasStrazdas@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:35:07 +0200 Subject: [PATCH 2/3] Focus node on expander click --- .../itwinui/TreeNodeRenderer.css | 6 ++++++ .../itwinui/TreeNodeRenderer.tsx | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css index 8aa3d60de..2fb31b2da 100644 --- a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css +++ b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css @@ -17,6 +17,12 @@ visibility: visible; } +.stateless-tree-node:focus-within { + outline: 1px solid var(--iui-color-border-accent); + outline-offset: -1px; + border-radius: var(--iui-border-radius-1); +} + .stateless-tree-node-small-spinner { height: var(--iui-size-s); width: var(--iui-size-s); diff --git a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx index 2035e259b..d0244c890 100644 --- a/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx +++ b/packages/hierarchies-react/src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx @@ -101,9 +101,6 @@ export const TreeNodeRenderer: React.ForwardRefExoticComponent { expandNode(node.id, isExpanded); }} - expanderProps={{ - onMouseDown: (e) => e.preventDefault(), - }} icon={getIcon ? getIcon(node) : undefined} label={getLabel ? getLabel(node) : node.label} sublabel={getSublabel ? getSublabel(node) : undefined} From ff1a102129e7c2a272387df6a9e90677bac96979 Mon Sep 17 00:00:00 2001 From: Martynas Strazdas <43886789+MartynasStrazdas@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:45:17 +0200 Subject: [PATCH 3/3] change --- .changeset/pink-paws-refuse.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-paws-refuse.md diff --git a/.changeset/pink-paws-refuse.md b/.changeset/pink-paws-refuse.md new file mode 100644 index 000000000..5fc9084b2 --- /dev/null +++ b/.changeset/pink-paws-refuse.md @@ -0,0 +1,5 @@ +--- +"@itwin/presentation-hierarchies-react": patch +--- + +Clicking on tree node buttons now visually show focus on node.