Skip to content

Commit cbdf944

Browse files
authored
fix(ObjectPageTitle): correct screen reader reading order (#8753)
Fixes #8752
1 parent e3dc256 commit cbdf944

3 files changed

Lines changed: 33 additions & 28 deletions

File tree

packages/main/src/components/ObjectPage/ObjectPage.cy.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -746,19 +746,19 @@ describe('ObjectPage', () => {
746746
cy.get('[data-component-name="ObjectPageTabContainer"]').should('not.exist');
747747

748748
cy.findByText('Update Heights').click();
749-
cy.findByText('{"offset":1080,"scroll":2280}').should('exist');
749+
cy.findByText('{"offset":1080,"scroll":2270}').should('exist');
750750

751751
cy.findByTestId('op').scrollTo('bottom');
752752
cy.findByText('Update Heights').click({ force: true });
753-
cy.findByText('{"offset":1080,"scroll":2280}').should('exist');
753+
cy.findByText('{"offset":1080,"scroll":2270}').should('exist');
754754

755755
cy.mount(<TestSingleSectionComp height="2000px" withFooter mode={ObjectPageMode.Default} />);
756756
cy.findByText('Update Heights').click();
757-
cy.findByText('{"offset":1080,"scroll":2330}').should('exist');
757+
cy.findByText('{"offset":1080,"scroll":2310}').should('exist');
758758

759759
cy.findByTestId('op').scrollTo('bottom');
760760
cy.findByText('Update Heights').click({ force: true });
761-
cy.findByText('{"offset":1080,"scroll":2330}').should('exist');
761+
cy.findByText('{"offset":1080,"scroll":2310}').should('exist');
762762

763763
cy.mount(<TestSingleSectionComp height="400px" mode={ObjectPageMode.Default} />);
764764
cy.findByText('Update Heights').click();
@@ -812,19 +812,19 @@ describe('ObjectPage', () => {
812812
cy.get('[data-component-name="ObjectPageTabContainer"]').should('not.exist');
813813

814814
cy.findByText('Update Heights').click();
815-
cy.findByText('{"offset":1080,"scroll":2250}').should('exist');
815+
cy.findByText('{"offset":1080,"scroll":2230}').should('exist');
816816

817817
cy.findByTestId('op').scrollTo('bottom');
818818
cy.findByText('Update Heights').click({ force: true });
819-
cy.findByText('{"offset":1080,"scroll":2250}').should('exist');
819+
cy.findByText('{"offset":1080,"scroll":2230}').should('exist');
820820

821821
cy.mount(<TestSingleSectionComp height="2000px" withFooter mode={ObjectPageMode.IconTabBar} />);
822822
cy.findByText('Update Heights').click();
823-
cy.findByText('{"offset":1080,"scroll":2310}').should('exist');
823+
cy.findByText('{"offset":1080,"scroll":2290}').should('exist');
824824

825825
cy.findByTestId('op').scrollTo('bottom');
826826
cy.findByText('Update Heights').click({ force: true });
827-
cy.findByText('{"offset":1080,"scroll":2310}').should('exist');
827+
cy.findByText('{"offset":1080,"scroll":2290}').should('exist');
828828

829829
cy.mount(<TestSingleSectionComp height="400px" mode={ObjectPageMode.IconTabBar} />);
830830
cy.findByText('Update Heights').click();
@@ -850,7 +850,7 @@ describe('ObjectPage', () => {
850850
cy.findByText('Update Heights').click({ force: true });
851851
cy.findByText('{"offset":1080,"scroll":1080}').should('exist');
852852

853-
cy.mount(<TestSingleSectionComp height="925px" mode={ObjectPageMode.IconTabBar} />);
853+
cy.mount(<TestSingleSectionComp height="950px" mode={ObjectPageMode.IconTabBar} />);
854854
cy.findByText('https://github.com/UI5/webcomponents-react').should('be.visible');
855855

856856
cy.wait(50);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
}
3636
}
3737

38+
.titleAndSubHeader {
39+
flex: 1 1 auto;
40+
min-width: 0;
41+
}
42+
3843
.titleMainSection {
3944
overflow-x: hidden;
4045
flex: 1 1 auto;

packages/main/src/components/ObjectPageTitle/index.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,25 @@ const ObjectPageTitle = forwardRef<HTMLDivElement, ObjectPageTitlePropTypes>((pr
158158
className={classNames.middleSection}
159159
data-component-name="ObjectPageTitleMiddleSection"
160160
>
161-
<FlexBox className={classNames.titleMainSection} onClick={onHeaderClick}>
162-
{_header && (
163-
<div className={classNames.title} data-component-name="ObjectPageTitleHeader">
164-
{_header}
165-
</div>
166-
)}
167-
{children && (
168-
<div className={classNames.content} data-component-name="ObjectPageTitleContent">
169-
{children}
161+
<FlexBox direction={FlexBoxDirection.Column} className={classNames.titleAndSubHeader}>
162+
<FlexBox className={classNames.titleMainSection} onClick={onHeaderClick}>
163+
{_header && (
164+
<div className={classNames.title} data-component-name="ObjectPageTitleHeader">
165+
{_header}
166+
</div>
167+
)}
168+
{children && (
169+
<div className={classNames.content} data-component-name="ObjectPageTitleContent">
170+
{children}
171+
</div>
172+
)}
173+
</FlexBox>
174+
{_subHeader && (
175+
<div
176+
className={clsx(classNames.subTitle, classNames.subTitleBottom)}
177+
data-component-name="ObjectPageTitleSubHeader"
178+
>
179+
{_subHeader}
170180
</div>
171181
)}
172182
</FlexBox>
@@ -184,16 +194,6 @@ const ObjectPageTitle = forwardRef<HTMLDivElement, ObjectPageTitlePropTypes>((pr
184194
</div>
185195
)}
186196
</FlexBox>
187-
{_subHeader && (
188-
<FlexBox id="sub">
189-
<div
190-
className={clsx(classNames.subTitle, classNames.subTitleBottom)}
191-
data-component-name="ObjectPageTitleSubHeader"
192-
>
193-
{_subHeader}
194-
</div>
195-
</FlexBox>
196-
)}
197197
</FlexBox>
198198
</FlexBox>
199199
{props?.['data-header-content-visible'] ? expandedContent : snappedContent}

0 commit comments

Comments
 (0)