Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force re-measurement of scrollbars #182

Closed
wants to merge 7 commits into from

Conversation

nickfogler
Copy link

Use case is the parent container of my SlickGrid instance is hidden during instantiation, so scrollbar measurement is returning {width: 0, height: 0}. Need a way to force a re-measurement after parent container is visible. There might be a better place than this to do so...?

@ghiscoding
Copy link
Collaborator

ghiscoding commented Dec 21, 2017

It looks like the only reason you've added the code change is because measureScrollbar function is not exported. Isn't it easier to just export measureScrollbar as public? Unless you really need the call the resizeCanvas() for some other reasons?

@nickfogler
Copy link
Author

I don't need the result of measureScrollbar() exported - that's already available with getScrollbarDimensions(). I need the value of scrollbarDimensions to be updated internally, so the other internal functions that use that value will be updated (and then force the canvas to redraw taking into account the correct scrollbar values).

@6pac
Copy link
Owner

6pac commented Dec 29, 2017

Apologies for not using this PR, it was the list of commits that put me off - just creates a lot of noise in the commit list.
I have made the following change, which will have the same net effect:

  if (!scrollbarDimensions || !scrollbarDimensions.width) {
    scrollbarDimensions = measureScrollbar();
  }

This is committed to the repo but I haven't issued a new release yet.

@6pac 6pac closed this Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants