Panel Component React: custom style className not applied in SPFx web part.
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 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 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 !
Hi @hbrigui, any updates on the codepen? it would be great to see a repro.
Yes i can confirm , this is not working
is this still not working ?
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
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!