fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Unable to disable the header/tab Link for the Pivot

Open dhavalshah01 opened this issue 8 years ago • 5 comments

Bug Report

  • Package version(s): 1.5.1
  • Browser and OS versions: Chrome

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes)

Requested priority: (Blocking)

Products/sites affected:

Describe the issue:

We are unable to disable the link for the Pivot tabs or headers. As per doc, linkIsDisabled property should disable the link on the header. But there is no way we can use this interface IPivotStyleProps.

Actual behavior:

Link is not getting disabled.

Expected behavior:

Link should be disabled

dhavalshah01 avatar Jul 30 '18 21:07 dhavalshah01

The LinkItem should have a disabled prop, if you'd like to submit a PR please free free!

dzearing avatar Jul 30 '18 22:07 dzearing

This is affecting me too. In addition, conditionally removing PivotItem instances causes the Pivot control to crash:

image

Consider the following Pivot use-case:

render() {
  return (
     <Pivot>
        {this.props.item.isNew && <PivotItem>
            ...content
        </PivotItem>
     </Pivot>
  )
}

Pivot.base.jsx is trying to dereference the type property on null. typeof child === 'object' is not a safe method of checking an object exists, as null is an object. The unfortunate inflexibility is blocking us at the moment. I am more than happy to submit a PR if OP doesn't have the time.

tylerjwatson avatar Aug 07 '18 08:08 tylerjwatson

Any news how to remove the links from the tabs of the Pivot component? I just want to go from tab to tab via a button below and disable the links in the component.

mvahsen avatar Dec 03 '18 09:12 mvahsen

looks like pivot uses 'headerButtonProps' to pass typical button props in. We'll probably change this in the future to allow disabled to be on the item itself, but for now this works.

https://codepen.io/micahgodbolt/pen/GBQyRW#settings-js

micahgodbolt avatar Dec 28 '18 00:12 micahgodbolt

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!

msft-github-bot avatar Jan 01 '19 01:01 msft-github-bot