question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with size in percentage

See original GitHub issue

Describe the bug When manipulating the “size” attribute, it starts to behave weirdly. When I drag one column, it does it perfectly, but when I try to drag the same one (again) or another one, it does not respond to the mouse drag movement. After making a click on the gutter, then it starts working again. Why is this happening? It did not happen in the previous version. I just updated today.

To Reproduce

<as-split [direction]="direction" [gutterSize]="columnSeparatorWidth" (gutterClick)="hideColumn($event)"
      (dragStart)="dragStart($event)" (dragEnd)="columnResized($event)" #mySplitA
       [unit]="'percent'">
      <as-split-area [size]="columns.pending.width">
      </as-split-area>
      <as-split-area [size]="columns.editor.width">
      </as-split-area>
      <as-split-area [size]="columns.live.width">
      </as-split-area>
    </as-split>
columnResized(event: any) {
    if (event.sizes[0] > 0) {
      this.columns.pending.width_aux = event.sizes[0];
    }
    this.columns.pending.width = event.sizes[0];
    if (event.sizes[1] > 0) {
      this.columns.editor.width_aux = event.sizes[1];
    }
    this.columns.editor.width = event.sizes[1];
    if (event.sizes[2] > 0) {
      this.columns.live.width_aux = event.sizes[2];
    }
    this.columns.live.width = event.sizes[2];
  }

If I comment these lines:

this.columns.pending.width = event.sizes[0];
this.columns.editor.width = event.sizes[1];
this.columns.live.width = event.sizes[2];

It starts working. But I need to assign these values and I need them to be attached to the size attribute in the view.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
eramirezproteccommented, May 7, 2019

Updated! Works great. Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why would I ever NOT use percentage for sizes?
I think the major problem with percentages is that the question always comes down to "percentage to what?". To the viewport? To the...
Read more >
Problem with fixed width layouts and percentage based widths
While designing fixed width layouts it is advantageous to use percentage based width for inner containers in the layout to make it easy...
Read more >
Css height in percent not working [duplicate] - Stack Overflow
For an element to have a relative height it has to have a parent element with a specified size, for it's own size...
Read more >
Sample Size Needed to Estimate a Percentage ... - YouTube
... thank you!!! https://goo.gl/JQ8NysSample Size Needed to Estimate a Percentage with StatCrunch Given the Margin of Error.
Read more >
Finding the Sample Size needed to Estimate a Percentage ...
Please Subscribe here, thank you!!! https://goo.gl/JQ8NysFinding the Sample Size needed to Estimate a Percentage given the Margin of Error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found