Skip to content

Conversation

@rawagner
Copy link
Contributor

ref width hook reacts only on resize and nav_toggle events which in some cases may not be enough - component may get rerendered with different size but non of the mentioned events happened.

Actual scenario where this is causing issues is in Grid component https://github.com/openshift/console/blob/master/frontend/public/components/dashboard/grid.tsx#L21 which on the first render renders narrow grid as width is 0 in the beginning. We have various charts as grid items and they compute their width/height also with ref-width-hook. Second render of grid renders wide grid (width from width-ref-hook is populated with actual value) which changes the size of cards (thus size of charts) but charts are not updated with new width because their width didnt change due to resize or nav_toggle

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 16, 2019
@spadgett
Copy link
Member

/assign @TheRealJon

@spadgett spadgett added this to the v4.2 milestone Jul 17, 2019
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2019
@spadgett
Copy link
Member

/approve
/retest

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rawagner, spadgett, TheRealJon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2019
@openshift-merge-robot openshift-merge-robot merged commit 4577da9 into openshift:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants