Exact same situation and doc.layerTree.includes(l) on 22.3.1 still returns true if selected layer is on a top level tree, but 22.4.0 and 22.4.1 return false. My whole (payed) plugin is based on that selection and it doesn’t work anymore. Not cool at all
Any advice what would be the best approach to fix this? Or simply loop both arrays and check for layers IDs?
FYI @Barkin / @heewoo / @samgannaway – Looks like a bug in the layer map cache. AFAICT, a new Layer object is always being created, rather than the old one being re-used if it exists. (Check src/dom/Layer.ts#PSLayer’s history – there’s a change around 3mo ago that may be involved – Pull #118)