Hi,
I have seen a bug that is happening in weird places that the order of items rendered gets switched up
I have code similar to:
<div>
{logic && <div>...</div>}
{!logic && <h1>...</h1>}
<Wrapper>...</Wrapper>
</div>
when it renders first time its fine but if it rerenders with the logic changed it sometimes reverses the order of the 2 items that come out, this is really difficult to reproduce, was trying yesterday but could not come up with anything
This happens in many places, sometimes a form field gets pushed down or modal title ends up at the bottom etc.
I will try again today to have a repro of this problem
Interesting, that's one I haven't seen yet. Perhaps something to do with recycling...
yes, this is a weird one, I don't think this happened in 4.8 though, maybe that would be a clue in finding what it could be
I have a case that the problem happens every time (beta6), though didn't manage to reproduce the same scenario in jsfiddle yet
when testing on ff got the error: IndexSizeError: Index or size is negative or greater than the allowed amount on the line: https://github.com/developit/preact/blob/7785c5e9a07ebc3651eeb77d76d47d9951ae6b9b/src/dom/index.js#L61
this happens on the same page that has the ordering problem, this could be related, If not I can create a separate issue
Interesting - I'm actually already going to wrap that line in a try block, hopefully that's the bug!
test case: https://jsfiddle.net/p16ea27s/
Fix is up as preact@beta ([email protected]). Thanks again!
Most helpful comment
Fix is up as
preact@beta([email protected]). Thanks again!