Fluentui: Disable pivot item

Created on 29 May 2019  ·  11Comments  ·  Source: microsoft/fluentui

I want to disable a Pivot item. Is that possible?

Pivot Author Feedback Feature Question ❔

Most helpful comment

@simkessy it is currently possible; by using headerButtonProps, you can pass a prop. You'll have to manage the style though.
Codepen

<PivotItem 
  headerText="Recent"
  headerButtonProps={{
    'disabled': true,
    'style': {color: 'grey'}
    }}
>

All 11 comments

Hi @simkessy, after looking through the code, it doesn't seem like it's an available option. We can add this to our backlog as a feature request if it's something that you would like to have. @jdhuntington, as a Pivot code owner can you confirm/deny this?

@leddie24 , I think it would be useful. Thanks.

Thanks @simkessy - we will add this to our backlog.
In coming up with a plan, a few thoughts that come to find:

  • What should happen if a disabled Pivot is also passed in as active pivot? Should it display an empty pane?
  • How is a disabled pivot reflected visually?

We will likely will not be able to implement this feature in the immediate future, though would be happy to accept pull requests.

@simkessy it is currently possible; by using headerButtonProps, you can pass a prop. You'll have to manage the style though.
Codepen

<PivotItem 
  headerText="Recent"
  headerButtonProps={{
    'disabled': true,
    'style': {color: 'grey'}
    }}
>

@j-te ill try that out!

@simkessy did @j-te's solution ended up working for you?

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!

I'm also in need of this feature. I believe the disabled state should only disable user interaction; if it's passed in as active, or programmatically changed it should obey such behavior and leave it up to the developer to handle those cases gracefully.

I would also think that a grey disabled style should suffice, in the same vein as disabled buttons, but without modifying any backgrounds.

I'm happy to implement this if need be.

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!

@simkessy it is currently possible; by using headerButtonProps, you can pass a prop. You'll have to manage the style though.
Codepen

<PivotItem 
  headerText="Recent"
  headerButtonProps={{
    'disabled': true,
    'style': {color: 'grey'}
    }}
>

Hi.
I tried and

'disabled': true,

works, but the style don't.

Hi.
I tried and

'disabled': true,

works, but the style don't.

@gioce90 Seems to be working on ver 7.25.0. Happy to help if you can show us your code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

holysnake91 picture holysnake91  ·  3Comments

luisrudge picture luisrudge  ·  3Comments

nekoya picture nekoya  ·  3Comments

luisrudge picture luisrudge  ·  3Comments

rickyp-ms picture rickyp-ms  ·  3Comments