-
Notifications
You must be signed in to change notification settings - Fork 102
Don't prevent default event of inserting # when linking recipes #914
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
Don't prevent default event of inserting # when linking recipes #914
Conversation
When refactoring they keydown handler of EditInputGroup, a regression was introduced where the # would not be inserted when linking to another recipe. This is because we previously had a keyup event listener, which cannot prevent the key from being insterted, but now we are using a keydown listener, which can. Therefore, the `e.preventDefault()` that was already present in the code now has unintended side effects. We can remove it, there is no reason to have it there. Signed-off-by: Marcel Robitaille <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #914 +/- ##
=======================================
Coverage 20.20% 20.20%
=======================================
Files 20 20
Lines 1440 1440
=======================================
Hits 291 291
Misses 1149 1149
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
No, I cannot confirm this to be a fix. At least on my machine (Archlinux Firefox) this triggers a bit of a different behavior: When I type a |
|
I made a screencast to show my problems. This is different for you? 2022-03-13.16-37-48.mp4I tested it with firefox + chrome on Win 10 using Browserstack. The same effect happens as in the video. |
|
That is very strange. I can reproduce this. It seems that the |
The previous fix of switching to keydownwas not viable. The # would appear in the popup instead of in the main input. This would show no results in the popup since none have #, and would insert the wrong thing into the main input. Fix this by reverting the linking event handler back to keyup. This has fewer unintended consequences. I also think that the flow is cleaner now that enter and # are handled in two separate functions. Signed-off-by: Marcel Robitaille <[email protected]>
…n-linking Signed-off-by: Christian Wolf <[email protected]>
Signed-off-by: Christian Wolf <[email protected]>
christianlupus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good enough to me as a fix. LGTM
Fixes #905
When refactoring they keydown handler of EditInputGroup, a regression was introduced where the # would not be inserted when linking to another recipe. This is because we previously had a keyup event listener, which cannot prevent the key from being insterted, but now we are using a keydown listener, which can. Therefore, the
e.preventDefault()that was already present in the code now has unintended side effects. We can remove it, there is no reason to have it there.