fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Panel: Support custom 'near' Panel

Open hamedy opened this issue 8 years ago • 11 comments

hi, I need to set the styling on Panel so that it slides in from the left side. IPanelStyleProps has a property called isOnRightSide that I believe would do it. But I can't figure out how to implement it. Can someone provide an example please?

hamedy avatar Oct 19 '18 09:10 hamedy

Have you tried using <Panel type={PanelType.smallFixedNear} ... />? That panel type is positioned on the left side of the screen. It's the second example in the documentation.

mikewheaton avatar Oct 19 '18 15:10 mikewheaton

yes, but I need custom width, and the only option for custom width is sliding from the right side. And in general I find this interface that's used for Styles on a lot of components quite confusing: IStyleFunctionOrObject<IPanelStyleProps, IPanelStyles>

can't figure out how to use it. how would one create a simple object that implements IPanelStyleProps and set a property like isOnRightSide?

Appreciate your help :)

hamedy avatar Oct 19 '18 18:10 hamedy

Yeah, looks like custom is on the 'far' side. We'd need to change the component to be able to support this. We probably need a customNear type, since supporting every 'type' with 'near/far' is probably a large refactor.

micahgodbolt avatar Oct 19 '18 18:10 micahgodbolt

what would you say is the better way to make the smallfixednear type a bit wider?

hamedy avatar Oct 19 '18 19:10 hamedy

Ok, without a major rewrite of a bunch of panel innards I'd say a customNear is the best approach. You could easily put a regular 'custom' on the left hand side...but the drop shadow would be wrong

micahgodbolt avatar Oct 19 '18 19:10 micahgodbolt

could you explain how, please?

hamedy avatar Oct 21 '18 17:10 hamedy

I'm sorry...I went stream of thoughts there for a bit. My answer is that we are missing this functionality right now. I've marked this as a level 2 feature request and will put it in our backlog. If you are interested in tackling this work sooner, I'd be happy to give you a hand.

micahgodbolt avatar Oct 22 '18 15:10 micahgodbolt

I set some css to override-

.root-59 .main-103 { width: 500px; }

But it's a bit janky as the animation isn't smooth. A proper fix would be great.

jumpmanjay avatar Oct 31 '18 18:10 jumpmanjay

I had the same issue and I resolved using PanelType.smallFixedNear and setting styles property to

{ main: { width: '500px !important' } }

You must work only on the media queries

MarcOne68 avatar Nov 30 '18 09:11 MarcOne68

similar to #6658 i think panel needs to be split into a generic container and the Panel as it is today. This will allow the underlined panel base to support any position while the Panel control will contain styles required to support positions described in our style guide.

micahgodbolt avatar Dec 28 '18 22:12 micahgodbolt

closing this as it's tracked in #7625

xugao avatar Jan 31 '20 04:01 xugao