Skip to content

Commit

Permalink
Fix bullet item selection crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-megh-l committed Feb 14, 2024
1 parent 8e36a88 commit 5eb8b20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,10 @@ class QuillTextManager(quillSpan: QuillSpan) {
)
}

if (currentSpan != null) {
if (
currentSpan.style.contains(TextSpanStyle.BulletStyle) &&
editable[selection.min - 1] == '\n' &&
editable[selection.min - 2] != '\n'
) {
if (currentSpan != null && this.selection.collapsed) {
if (editable[selection.min - 1] == '\n' && editable[selection.min - 2] != '\n') {
addStyle(TextSpanStyle.BulletStyle)
} else if (
currentSpan.style.contains(TextSpanStyle.BulletStyle) &&
editable[selection.min - 1] == '\n' &&
editable[selection.min - 2] == '\n'
) {
} else if (editable[selection.min - 1] == '\n' && editable[selection.min - 2] == '\n') {
removeStyle(TextSpanStyle.BulletStyle)
} else {
this.currentStyles.addAll(currentStyles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ sealed interface TextSpanStyle {

object H2Style : TextSpanStyle {
override val key: String
get() = "h3"
get() = "h2"
override val style: Any
get() = RelativeSizeSpan(1.4f)

Expand Down

0 comments on commit 5eb8b20

Please sign in to comment.