mateagar / progressStep

A jQuery plugin that dynamically renders a progress bar with numbered steps.
Other
95 stars 32 forks source link

Progress Bar Keeps Moving Down On `refreshLayout` Calls #2

Open theonewolf opened 9 years ago

theonewolf commented 9 years ago

Repeated calls to refreshLayout continuously moves the progress bar down.

Commenting out this line stops the bar from moving down continuously:

https://github.com/mateagar/progressStep/blob/master/progressStep.js#L245

Is that line necessary? Do the height and the width need to be updated on every function call?

For some reason, the height keeps growing in size.

mateagar commented 9 years ago

Adjusting the height and width of the control is one of the primary purposes of the refreshLayout() method. That said, I'm not sure why doing so would increase the height incrementally with each call - perhaps it is a browser bug.

Do you need to call refreshLayout() so often? Typically this would be called once when the progress bar is displayed, and then not again unless the layout changes fundamentally.

theonewolf commented 9 years ago

Thanks for responding so quickly!

So we have a use case which wants to add and remove steps dynamically. Right now I was just removing steps. This results in multiple calls to refreshLayout.

I was removing them manually and then refreshing the layout. Everything worked as expected, except the entire graph moved down 5 pixels on every refresh.

Even if I don't modify the array/DOM/Raphael objects, the simple action of calling the function refreshLayout causes the move down 5 pixels.

I'm using Google Chrome 32-bit (43.0.2357.124) on Windows 8.1 64-bit.

comrade3X commented 8 years ago

hi bro, thank a lot for source. now, i need you to help me, please. I can't change default width. Please help me. Thank