Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: InputRules seem not to fire in 2.5.5 #5384

Closed
1 task done
Nantris opened this issue Jul 23, 2024 · 7 comments
Closed
1 task done

[Bug]: InputRules seem not to fire in 2.5.5 #5384

Nantris opened this issue Jul 23, 2024 · 7 comments
Assignees
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Info: Needs more info The issue or pullrequest needs more information before it can be worked on Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on Type: Bug The issue or pullrequest is related to a bug

Comments

@Nantris
Copy link
Contributor

Nantris commented Jul 23, 2024

Affected Packages

core

Version(s)

2.5.5

Bug Description

After upgrading from 2.5.4 to 2.5.5 several tests broke here. I took a look and it seems breakpoints inside of input rules are no longer being hit. Presumably it's not all input rules since only a few tests broke. Most of the broken tests seem to relate to lists.

Example input rule which no longer applies:

wrappingInputRule({
  find: taskItemRegex,
  type: this.type,
  getAttributes: match => ({
    checked: match.at(-1)?.toLowerCase() === 'x',
  }),
}),

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

InputRule behavior is unchanged from 2.5.4

Additional Context (Optional)

We have a custom parseHTML so it seems unlikely to me that this PR broke it: b47df57

At the same time, none of the others jump out to me as obvious causes either.

Dependency Updates

  • Yes, I've updated all my dependencies.
@Nantris Nantris added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Jul 23, 2024
@nperez0111
Copy link
Contributor

@Nantris I don't see anything that would be different here for input rules between these versions: @tiptap/vue-3@2.5.4...v2.5.5

2.5.5 was mostly around vue 3 performance updates, are you using vue-3?

The only other code change could have been: #5321

I would need more information to help you out here

@nperez0111 nperez0111 added Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on Info: Needs more info The issue or pullrequest needs more information before it can be worked on labels Jul 24, 2024
@nperez0111
Copy link
Contributor

Is it just the one input rule that is not applying? Could your parseHTML not be applying? Maybe you have the task list extension installed twice? I don't know what could be breaking you here

@nperez0111
Copy link
Contributor

Any update on this @Nantris? I've also addressed a couple more bugs since so may be worth upgrading

@Nantris
Copy link
Contributor Author

Nantris commented Jul 27, 2024

@nperez0111 thanks for the ping on this.

I tried 2.5.7 but the issue persisted.

I was able to identify the problem commit: 4cca3826950176b6d9981cdc6e1e9b654f696319 but heck if I know why.

None of the affected rules seem to have anything to do with atom nodes. Unfortunately I'm finding it impossible to set breakpoints or logpoints in the .ts files, maybe due to some problem in the sourcemaps, so I can't readily provide as much information as I'd like (eg why this is making any difference in a document without any atom nodes present.)

Via manually editing the file in node_modules I was able to at least determine the behavior difference:

  • 2.5.5 (Problem): {textBefore: '[x]abc'}
  • 2.5.4 (No problem): {textBefore: '[x]'}

In both cases the caret was in the position immediately after the [x]| (pipe character representing caret), so the abc should not be considered part of the textBefore.

Thanks again for the great work you're doing @nperez0111!

@nperez0111
Copy link
Contributor

Thanks for hunting this down @Nantris I found the bug & will be resolved by: #5407

@nperez0111
Copy link
Contributor

Should be resolved already with v2.5.9

@Nantris
Copy link
Contributor Author

Nantris commented Aug 13, 2024

Confirmed resolved; forgot to close. Thanks for your great work @nperez0111!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Info: Needs more info The issue or pullrequest needs more information before it can be worked on Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

No branches or pull requests

2 participants