mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
chore: allow cursor in none-contenteditable blocks (#11366)
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
stdContext,
|
||||
TextSelection,
|
||||
} from '@blocksuite/std';
|
||||
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/std/inline';
|
||||
import type { BlockModel, Store } from '@blocksuite/store';
|
||||
import { Text } from '@blocksuite/store';
|
||||
import { consume } from '@lit/context';
|
||||
@@ -121,6 +122,8 @@ export class BlockCaptionEditor<
|
||||
override connectedCallback(): void {
|
||||
super.connectedCallback();
|
||||
|
||||
this.setAttribute(RANGE_SYNC_EXCLUDE_ATTR, 'true');
|
||||
|
||||
this.caption = this.model.props.caption;
|
||||
|
||||
this.disposables.add(
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
SearchIcon,
|
||||
} from '@blocksuite/icons/lit';
|
||||
import { ShadowlessElement } from '@blocksuite/std';
|
||||
import { RANGE_SYNC_EXCLUDE_ATTR } from '@blocksuite/std/inline';
|
||||
import {
|
||||
autoPlacement,
|
||||
autoUpdate,
|
||||
@@ -383,6 +384,7 @@ export const getDefaultModalRoot = (ele: HTMLElement) => {
|
||||
};
|
||||
export const createModal = (container: HTMLElement = document.body) => {
|
||||
const div = document.createElement('div');
|
||||
div.setAttribute(RANGE_SYNC_EXCLUDE_ATTR, 'true');
|
||||
div.style.pointerEvents = 'auto';
|
||||
div.style.position = 'absolute';
|
||||
div.style.left = '0';
|
||||
|
||||
Reference in New Issue
Block a user