fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Panel Component React: custom style className not applied in SPFx web part.

Open hbrigui opened this issue 8 years ago • 7 comments

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: High

Products/sites affected: SharePoint client side web parts.

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Describe the issue:

Panel not affected when i use className={styles.CustomStyle} also for components introduced into Panel.

Actual behavior:

Panel and its components cannot use className custom styles

Expected behavior:

The custom styles should be possible for Panel and Modal Component

If applicable, please provide a codepen repro:

i share with you code example which is employed in Spfx WebPart :

<Panel
           isLightDismiss={true}                          
           isBlocking={true}
           isOpen={this.state.showUsersListPanel}
           onDismiss={this.setshowUsersListPanel(false)}
           type={PanelType.medium}
           className={ styles.MarginPanel } /* this styles not loading and not working for Panel*/
           closeButtonAriaLabel='Close'>
<DetailsList
      className={ styles.DetailListSites } /* this styles not loading and not working for this component*/
      items={this.state.spPermissionsSiteInfo.usersList}
       selectionMode={SelectionMode.none}
       columns={[....]}
       onRenderItemColumn={ this._onRenderItemColumn }
  />
</Panel>

hbrigui avatar Mar 13 '18 11:03 hbrigui

@hbrigui thanks for reporting and sharing the code sample. A few questions:

  • What version of Fabric React are you seeing this behavior in?
  • Does this only happen when applied within web parts?
    • Can you repro from a CodePen with a recent version of Fabric?

@manishgarg1 for FYI in case this is an issue with SPfx. Please loop in others as appropriate. Thanks!

Jahnp avatar Mar 15 '18 06:03 Jahnp

@Jahnp thanks for commented, so to answer your questions:

  • Office fabric ui used version is 1.4.3.
  • For the time being I tested only on SPfx Web Part and I have never tested it for another case -> Ok, i will try to repro it on CodePen with recent version Fabric

Thanks !

hbrigui avatar Mar 15 '18 09:03 hbrigui

Hi @hbrigui, any updates on the codepen? it would be great to see a repro.

manishgarg1 avatar May 01 '18 20:05 manishgarg1

Yes i can confirm , this is not working

harshdamaniahd avatar Jun 14 '18 09:06 harshdamaniahd

is this still not working ?

harshdamaniahd avatar Sep 25 '18 11:09 harshdamaniahd

The className is passed the most outer div of the panel. You can pass a className to the 'main' section using the styles prop

https://codepen.io/micahgodbolt/pen/LMjggd

micahgodbolt avatar Dec 27 '18 18: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 Dec 31 '18 19:12 msft-github-bot