@@ -126,7 +126,8 @@ type Story = StoryObj<typeof meta>;
126
126
export const Default : Story = {
127
127
render ( args ) {
128
128
return (
129
- < ObjectPage { ...args } >
129
+ // `onBeforeNavigate` has to be called like this, otherwise it's invoked two times for some reason.
130
+ < ObjectPage { ...args } onBeforeNavigate = { args . onBeforeNavigate } >
130
131
< ObjectPageSection titleText = "Goals" id = "goals" aria-label = "Goals" >
131
132
< Form layout = "S1 M2 L3 XL3" labelSpan = "S12 M12 L12 XL12" >
132
133
< FormItem labelContent = { < Label showColon > Evangelize the UI framework across the company</ Label > } >
@@ -305,7 +306,7 @@ export const SectionWithCustomHeader: Story = {
305
306
name : 'section with custom header' ,
306
307
render ( args ) {
307
308
return (
308
- < ObjectPage { ...args } >
309
+ < ObjectPage { ...args } onBeforeNavigate = { args . onBeforeNavigate } >
309
310
< ObjectPageSection
310
311
titleText = "Goals"
311
312
hideTitleText
@@ -349,7 +350,7 @@ export const FullScreenSingleSection: Story = {
349
350
name : 'with fullscreen section' ,
350
351
render ( args ) {
351
352
return (
352
- < ObjectPage { ...args } mode = { ObjectPageMode . IconTabBar } >
353
+ < ObjectPage { ...args } mode = { ObjectPageMode . IconTabBar } onBeforeNavigate = { args . onBeforeNavigate } >
353
354
< ObjectPageSection titleText = "Section 1" id = "section1" style = { { height : '100%' } } >
354
355
< div style = { { height : '100%' , background : 'lightblue' } } >
355
356
It is recommended to only use fullscreen sections in TabBar mode, otherwise your layout will most probably
@@ -378,6 +379,7 @@ export const LegacyToolbarSupport: Story = {
378
379
return (
379
380
< ObjectPage
380
381
{ ...args }
382
+ onBeforeNavigate = { args . onBeforeNavigate }
381
383
ref = { objectPageRef }
382
384
titleArea = {
383
385
< ObjectPageTitle
0 commit comments