Skip to content

Conversation

@nielslyngsoe
Copy link
Member

Fixes #20377

Makes the Block only clickable when it has Content properties.

Copilot AI review requested due to automatic review settings November 14, 2025 09:54
Copilot finished reviewing on behalf of nielslyngsoe November 14, 2025 09:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where block elements were clickable even when they had no content properties to edit. The change ensures blocks are only interactive when showContentEdit is true, improving the user experience by preventing unnecessary clicks on non-editable blocks.

  • Adds readonly property to block ref components to control interactivity based on whether content editing is available
  • Removes unused constructor and state management code in the RTE block component that was tracking workspace edit path
  • Adds user-select: none CSS styling to prevent text selection on block labels

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ref-rte-block.element.ts Removed unused constructor and workspace path tracking; added readonly property and user-select CSS
ref-list-block.element.ts Added readonly property to control clickability; added user-select CSS
block-grid-block.element.ts Added readonly property to control clickability; added user-select CSS
Comments suppressed due to low confidence (2)

src/Umbraco.Web.UI.Client/src/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.ts:1

  • The state import is no longer used after removing the constructor and _workspaceEditPath state property. It should be removed from the import statement.
import { css, customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit';

src/Umbraco.Web.UI.Client/src/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.ts:3

  • The UMB_BLOCK_ENTRY_CONTEXT import is no longer used after removing the constructor that consumed this context. It should be removed from the imports.
import { UMB_BLOCK_ENTRY_CONTEXT } from '@umbraco-cms/backoffice/block';

@nielslyngsoe nielslyngsoe changed the title Only interactive-open area when editable Block: open-interaction only available when Content is Editable Nov 14, 2025
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.

Block doesn't open if it has no content properties

2 participants