Skip to content

Commit

Permalink
fix: console error when pressing delete key in the paragraph before a…
Browse files Browse the repository at this point in the history
… database (toeverything#6285)
  • Loading branch information
ununian authored Feb 23, 2024
1 parent f6d3d62 commit f7fe5ae
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
focusTitle,
} from '../../../_common/utils/selection.js';
import type { ListBlockModel } from '../../../list-block/index.js';
import type { Flavour } from '../../../models.js';
import type { PageBlockModel } from '../../../page-block/index.js';
import type { ExtendedModel } from '../../types.js';

Expand Down Expand Up @@ -861,6 +862,20 @@ function handleParagraphBlockForwardDelete(
// TODO
return false;
} else {
const ignoreForwardDeleteFlavourList: Flavour[] = [
'affine:database',
'affine:image',
'affine:code',
'affine:attachment',
];

if (
nextSibling &&
matchFlavours(nextSibling, ignoreForwardDeleteFlavourList)
) {
return true;
}

return (
handleParagraphOrList(page, model, nextSibling, firstChild) ||
handleEmbedDividerCode(nextSibling, firstChild)
Expand Down

3 comments on commit f7fe5ae

@github-actions
Copy link

Choose a reason for hiding this comment

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

Size Report

Bundles

Entry Size Gzip Brotli
examples/basic 13.8 MB (+25.5 kB) 2.86 MB (+4.45 kB) 1.78 MB (+5.24 kB)

Packages

Name Size Gzip Brotli
blocks 2.18 MB (+4.31 kB) 507 kB (+1.06 kB) 370 kB (+639 B)
editor 84 B 89 B 63 B
store 83 B 88 B 63 B
inline 84 B 88 B 63 B

@github-actions
Copy link

Choose a reason for hiding this comment

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

Size Report

Bundles

Entry Size Gzip Brotli
examples/basic 13.8 MB 2.86 MB 1.78 MB

Packages

Name Size Gzip Brotli
blocks 2.18 MB 507 kB 370 kB
editor 84 B 89 B 63 B
store 83 B 88 B 63 B
inline 84 B 88 B 63 B

@github-actions
Copy link

Choose a reason for hiding this comment

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

Size Report

Bundles

Entry Size Gzip Brotli
examples/basic 13.8 MB 2.86 MB 1.78 MB

Packages

Name Size Gzip Brotli
blocks 2.18 MB 507 kB 370 kB
editor 84 B 89 B 63 B
store 83 B 88 B 63 B
inline 84 B 88 B 63 B

Please sign in to comment.