This change uses the natural indexing rules of the browser by ordering canvas elements, rather than specifying a hard-coded z-index. This fixes issues relating to absolutely positioned canvases.
Context
I'm building a fun react-app that allows the moving around of little drawings on a kind of pin-board. Without this change, overlapping elements don't correctly obey the z-index of their parents, resulting in some weird visual issues:
But with this change, the CanvasDraw elements correctly obey their parents z-index:
What is this?
This change uses the natural indexing rules of the browser by ordering canvas elements, rather than specifying a hard-coded z-index. This fixes issues relating to absolutely positioned canvases.
Context
I'm building a fun react-app that allows the moving around of little drawings on a kind of pin-board. Without this change, overlapping elements don't correctly obey the z-index of their parents, resulting in some weird visual issues:
But with this change, the CanvasDraw elements correctly obey their parents z-index: