react-native-masonry icon indicating copy to clipboard operation
react-native-masonry copied to clipboard

Masonry fails to render all columns (except the last) on reload on Android only

Open maboelsoud opened this issue 6 years ago • 6 comments

Expected Behavior

the expected behaviour should be that the masonry is rendered correctly image

Current Behavior

when you refresh the app, the masonry fails to render all but the last column image

Possible Solution

inspecting the code, it seems that all the bricks are given a width and height of 'Nan', but only the bricks in the last column get called with "_setParentDimensions" in Mansonry.js.

Steps to Reproduce

Link to the expo repo: https://snack.expo.io/BJITHeTm7 Make sure the preview is activated and the phone used for the preview is an android.

  1. click "tap to play", the masonry should behave as expected
  2. go in the code, just press space at an empty area in the code to trigger a refresh
  3. look at the phone preview, the masonry should look buggy

Context (Environment)

Detailed Description

Possible Implementation

maboelsoud avatar Jul 18 '18 17:07 maboelsoud

Did you resolved it ? I am also facing the same issue

Dhanraj-bidchat avatar Jul 19 '18 09:07 Dhanraj-bidchat

Any progress on this? Having troubles with this issue as well

novalain avatar Aug 06 '18 20:08 novalain

temporary solution

constructor(props) {
    super(props);
    this.state = {
      data,
      columns: 3,
    };
  }

componentDidMount() {
    setTimeout(() => {
      this.setState({ columns: 2, padding: 5 });
    }, 500);

  }

vijaychouhan-rails avatar Sep 07 '18 08:09 vijaychouhan-rails

The same thing happens to me but @vijaychouhan-rails solutions do not work for me :/, any help?

Jose4gg avatar Dec 22 '18 18:12 Jose4gg

See the same issue on iOS. Need help ! Setting the columns to 3 and then back to 2 is not the correct way to handle this...

pramodxyle avatar Mar 29 '19 23:03 pramodxyle

+1

borgogelli avatar May 15 '19 16:05 borgogelli