Skip to content

empty document with (bolt) style triggers twice the change listener #2497

@eelco2k

Description

@eelco2k

Have you checked for an existing issue?

Flutter Quill Version

11.0

Steps to Reproduce

  1. start an empty quill editor.
  2. set cursor/caret in active white area
  3. press for example the "B" (bolt) button.
  4. press on letter on the keyboard. (H) for example

the function of the listener will execute twice...
textEditorController.changes.listen((DocChange event) {
// will exec. 2 times...
});

these are the delta's

{"before":[{"insert":"H\n"}],"change":[{"retain":1,"attributes":{"bold":true}}]},
{"before":[{"insert":"H\n"}],"change":[{"retain":1,"attributes":{"bold":true}}]}

Expected results

triggered only once with correct docChange

so only one entry:

{"before":[{"insert":"\n"}],"change":[{"insert": "H","attributes":{"bold":true}}]}

Actual results

see above

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingminorMinimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions