-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fixed autocomplete bug by enclosing div within a form tag #380 #616
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for your PR, I have left some comments
@@ -71,7 +68,8 @@ export class LeftPanelView extends TemplateView { | |||
} | |||
} | |||
)); | |||
const utilitiesRow = t.div({className: "utilities"}, [ | |||
const utilitiesRow = t.form({name:"utilities-form"}, [ |
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.
won't this submit the form now when you hit enter on the filter field?
@@ -1,12 +1,9 @@ | |||
/* | |||
Copyright 2020 Bruno Windels <bruno@windels.cloud> | |||
|
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.
Please don't introduce any unrelated white space changes
@@ -71,7 +68,8 @@ export class LeftPanelView extends TemplateView { | |||
} | |||
} | |||
)); | |||
const utilitiesRow = t.div({className: "utilities"}, [ | |||
const utilitiesRow = t.form({name:"utilities-form"}, [ |
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.
probably only the filter field should be in the form, not the button links?
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.
const utilitiesRow = t.form({ name: "utilities-form", onSubmit: (event) => { event.preventDefault(); // Prevent form submission // Additional code logic if needed }, }, [ // Form elements ]);
By adding the onSubmit event listener to the form element and calling event.preventDefault(), you can prevent the form from submitting when the enter key is pressed within the filter field or any other input field inside the form.
For issue #380, I have inserted a
<form>
that is wrapped around the<div>
as it is needed for the autocomplete as given at MDN so theutilitiesRow
variable now returns this<form>
.I have assigned a name attribute of
utilities-form
to the<form>
.Resolves #380
Signed-off-by: Aaryan Gautam aaryanyo123@gmail.com