wannabegeek / ng2-split-pane

Split View module for Angular 2
MIT License
43 stars 25 forks source link

primary-component-initialratio #17

Open kevinsoltis41 opened 7 years ago

kevinsoltis41 commented 7 years ago

I seem to have a tough time getting 'primary-component-initialratio' to work. In your Plunker, per your documentation, I expect a { 'primary-component-initialratio': 0.8 } on the 'vertical-split-pane' div to would result in 'Left' to be basically '80%' while 'Right' would be the remaining '20%'.

Am I missing some details or totally misunderstanding this property?

Thanks in advance.

samidabeast commented 7 years ago

I am also having this issue. I have tried it with .9 and 1 and it always goes basically in half.

herubber commented 7 years ago

the same to me, two divs always in half

bp-dev commented 7 years ago

Do you have dynamic values for primary-component-toggled-off or secondary-component-toggled-off? If they are true at the AfterViewInit stage, the ratio keeps its default value of 0.5, and initialRatio is not read again later.

samidabeast commented 7 years ago

I've tried with or without a lot of settings. Always is .5. Even in the demo provided it is at half.

How I have mine set up currently : <horizontal-split-pane [primary-component-minsize]="minChartSize" [secondary-component-minsize]="minDetailsSize" primary-component-initialratio="0.9" (on-begin-resizing)="minChartSize = 250" (on-ended-resizing)="resize()">

dush-man commented 7 years ago

Same issue, however, in my case the layout is not visible when its initialized, its encapsulating div has [hidden] on it. Does this matter?

craigsh commented 7 years ago

I have the same issue - can't get primary-component-initialratio to work, and it doesn't work in your own Plunkr

I'd love to have a fix for this!

panyann commented 7 years ago

<vertical-split-pane [primary-component-minsize]="350" [secondary-component-minsize]="600" [primary-component-toggled-off]="isSearchClosed" [secondary-component-toggled-off]="false" [primary-component-initialratio]="0.3">

When primary component is toggled off from the start, the ratio is set to 0.5 although I have set it to 0.3. Is there any workaround to fix it?