how to set two rect with 2 zIndex?
See original GitHub issue <Rect zIndex={100} id="upper-rect" draggable="true" x={2} y={0} width={100} height={1000} fill={'#555555'} onClick={null}/>
<Rect zIndex={5} id="lower-rect" draggable="true" x={20} y={20} width={50} height={50} fill={'#777777'} onClick={null}/>
Don’t works.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Using z-index - CSS: Cascading Style Sheets - MDN Web Docs
The first article of this guide, Stacking without the z-index property, explains how stacking is arranged by default. If you want to create...
Read more >How to set correct order of nodes using zIndex? - Konva
I will create a layer with two groups. The first group has two shapes (black rect and red circle). The second group has...
Read more >Z-Index Explained: How to Stack Elements Using CSS
I have always struggled with the CSS property z-index. It sounds so easy at first. Elements with a higher z-index value are displayed...
Read more >Stacking overlapping views with zIndex in Expo and React ...
zIndex is the Expo and React Native analog of CSS's z-index property which lets the developer control the order in which components are...
Read more >How to use zIndex in react-native - Stack Overflow
7 Answers 7 · 16. You just ended a full day of debugging on Android. · 2. Works fine on both platform ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to have a state with an array of rectangles. Instead of setting zIndex, you just need move them in the array and then render.
Ok. Looks like
zIndex
is confusing in react-konva. We should add a warning when someone trying to use it. It is totally good to usezIndex
in pure Konva. But it has no sense inreact-konva
, because for a correct order you just need to correctly definerender
function.