-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Unlinking text throws error Cannot read property 'index' of undefined #1259
Comments
I'm not able to reproduce this on macOS 10.12.2 Chrome 55. Is this happening for you consistently? Can anyone else reproduce consistently? |
I can reproduce this on the provided Codepen. When the cursor is placed somewhere within the link, but no selection is made, and I click 'Remove' in the link popup, the link is not removed and the error is thrown in the console. When I select the entire link and I press 'Remove' in the link popup, the link is successfully removed and no error is thrown. Got this in Chrome 55.0.2883.95, MacOS 10.12.2. |
Reproduce on playground.
|
I spend some time with this bug and found the source of the problem.
Adding source === Emitter.sources.USER breaks the removal of the link format on some browsers . Its probably fixes something else so I didn't PR. |
How did you isolate that commit @EladBet ? It being the culprit makes no sense. I'm still not able to reproduce. @JedWatson can you be more specific in your instructions? Which range of text to select, what to type into the link editor, did you hit enter or click to link, where precisely did you click to click away, and where precisely did you click within the link to the the link tooltip to show up. Also please disable all browser extensions and confirm. |
Notice @jhchen its not an edge case it is very easy to reproduce just make sure you follow the prerequisites. Prerequisites Chrome 55, on windows 10. Steps for Reproduction
Actual behavior
*** A few times it didn't happen to me on the first time, but after refreshing the page it happen again. |
@jhchen I am also experiencing this bug on a Mac with Chrome 56.0 It appears to happen sporadically for me. |
happens always on Quill playground at the homepage, Mac with Chrome 56 |
In case it is useful the intermittent vs consistent depends on how fast you click. Fast clickers never experience this because focus never shifts to the tooltip and slow clickers always experience this bug. |
Removing a link throws a JavaScript Error:
Uncaught TypeError: Cannot read property 'index' of undefined
Steps for Reproduction
Visit http://codepen.io/anon/pen/ygOXBV - This is a simple port of the code in the quickstart guide
Link some text using the link button in the toolbar. It will be selected and go blue.
Reposition the cursor away from the link then back into the link to get the in-context link popover. Click the "remove" link in the popover.
Expected behavior:
The link is removed
Actual behavior:
The link is not removed, and an error will be logged to the JavaScript console in the browser:
Note: If you reselect the entire linked text (the link button on the toolbar will go blue) and click the button in the toolbar, it will successfully remove the link. The error only occurs using the "remove" link in the edit link popover.
Platforms:
macOS Sierra 10.12.1
Tested in Safari 10.0.1 (12602.2.14.0.7) and Chrome 55.0.2883.95 (64-bit)
Version:
This bug appears to be a regression with 1.1.9
By reverting the version loaded from the cdn to either 1.1.8 or 1.1.0 in the codepen, I can't reproduce it.
The text was updated successfully, but these errors were encountered: