mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 08:09:52 +08:00
bb79781dd8
Closes: [BS-3050](https://linear.app/affine-design/issue/BS-3050/切换模式时,清除选区)
13 lines
339 B
TypeScript
13 lines
339 B
TypeScript
import { LifeCycleWatcher } from '@blocksuite/std';
|
|
|
|
// Auto Clear selection when switching doc mode.
|
|
export class AutoClearSelectionService extends LifeCycleWatcher {
|
|
static override readonly key = 'auto-clear-selection-service';
|
|
|
|
override unmounted() {
|
|
if (this.std.store.readonly) return;
|
|
|
|
this.std.selection.clear();
|
|
}
|
|
}
|