update
This commit is contained in:
@ -699,11 +699,17 @@ export class DeesWysiwygBlock extends DeesElement {
|
||||
];
|
||||
|
||||
protected shouldUpdate(changedProperties: Map<string, any>): boolean {
|
||||
// If selection state changed, we need to update for non-editable blocks
|
||||
const nonEditableTypes = ['divider', 'image', 'youtube', 'markdown', 'html', 'attachment'];
|
||||
if (changedProperties.has('isSelected') && this.block && nonEditableTypes.includes(this.block.type)) {
|
||||
// For non-editable blocks, we need to update the selected class
|
||||
const element = this.shadowRoot?.querySelector('.block') as HTMLElement;
|
||||
// If selection state changed, update the selected class without re-rendering
|
||||
if (changedProperties.has('isSelected') && this.block) {
|
||||
// Find the block element based on block type
|
||||
let element: HTMLElement | null = null;
|
||||
|
||||
// Build the specific selector based on block type
|
||||
const blockType = this.block.type;
|
||||
const selector = `.block.${blockType}`;
|
||||
|
||||
element = this.shadowRoot?.querySelector(selector) as HTMLElement;
|
||||
|
||||
if (element) {
|
||||
if (this.isSelected) {
|
||||
element.classList.add('selected');
|
||||
|
Reference in New Issue
Block a user