Skip to content

Commit 763e091

Browse files
authored
fix(Toolbar - compat): support React version >= 19.2 & StrictMode (#8073)
Fixes #8063
1 parent 1b367ce commit 763e091

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

packages/compat/src/components/Toolbar/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ const Toolbar = forwardRef<HTMLDivElement, ToolbarPropTypes>((props, ref) => {
211211
}
212212
return (
213213
<div
214-
ref={itemRef}
214+
ref={(node) => {
215+
if (controlMetaData.current[index]) {
216+
controlMetaData.current[index].ref.current = node;
217+
}
218+
}}
215219
key={index}
216220
className={classNames.childContainer}
217221
data-component-name="ToolbarChildContainer"

packages/main/src/components/ObjectPageTitle/ObjectPageTitle.module.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848

4949
.title {
5050
flex-shrink: 1;
51-
min-width: 3rem;
5251
overflow-x: hidden;
5352
font-family: var(--sapObjectHeader_Title_FontFamily);
5453
color: var(--sapObjectHeader_Title_TextColor);
@@ -123,20 +122,22 @@
123122
justify-content: flex-end;
124123
align-self: flex-start;
125124

125+
/*ToDo: remove after legacy toolbar support isn't required anymore*/
126+
&:has([data-in-object-page-title]) {
127+
min-width: 2.125rem;
128+
}
129+
> [data-component-name='Toolbar']:not(:first-child):last-child {
130+
width: unset;
131+
flex-shrink: 0;
132+
}
133+
126134
> [ui5-toolbar] {
127135
padding: 0;
128136
border: none;
129137
}
130-
131138
> [ui5-toolbar]:not(:first-child):last-child {
132139
flex: 0 1;
133140
}
134-
135-
> [data-component-name='Toolbar']:not(:first-child):last-child {
136-
width: unset;
137-
flex-shrink: 0;
138-
}
139-
140141
> [ui5-toolbar]:only-child {
141142
flex-grow: 1;
142143
flex-shrink: 0;

0 commit comments

Comments
 (0)