Skip to content

fix(gridsterItem): fix z-index on moving/resizing items being overridden by inline style#985

Open
naterchrdsn wants to merge 1 commit into
tiberiuzuld:masterfrom
naterchrdsn:fix/982-zindex-moving-item
Open

fix(gridsterItem): fix z-index on moving/resizing items being overridden by inline style#985
naterchrdsn wants to merge 1 commit into
tiberiuzuld:masterfrom
naterchrdsn:fix/982-zindex-moving-item

Conversation

@naterchrdsn

Copy link
Copy Markdown

Fixes #982

gridster-item-moving and gridster-item-resizing CSS classes had no effect because the inline z-index style set on each item always overrides class-based styles.

Root cause: zIndex() was a plain method that returned baseLayerIndex + layerIndex unconditionally, and was bound via [style.z-index] directly. The CSS classes .gridster-item-moving / .gridster-item-resizing set z-index: 2 but inline styles win in the cascade.

Fix:

  • Add isMoving and isResizing signals to GridsterItem
  • Convert zIndex() method to a computed() signal that bumps z-index by 1 when either flag is true
  • Set isMoving / isResizing in GridsterDraggable and GridsterResizable at drag/resize start and stop

This makes the stacking order reactive and correct without touching the CSS.

…den by inline style

The [style.z-index] host binding always emitted an inline style with the
base layer z-index (default: 1), which took precedence over the CSS
class rules for .gridster-item-moving and .gridster-item-resizing
(both set z-index: 2), making those rules effectively dead.

Add isMoving and isResizing signals to GridsterItem. Convert zIndex()
to a computed signal that bumps the z-index by 1 when either flag is
active. Wire set(true/false) calls into the drag/resize start and stop
handlers so the inline value itself is elevated during interaction,
eliminating the CSS specificity conflict.

Fixes tiberiuzuld#982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

z-index of .gridster-item-moving is ineffective due to inline styles

1 participant