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

Fixed autocomplete bug by enclosing div within a form tag #380 #616

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aaryan-gautam
Copy link

@aaryan-gautam aaryan-gautam commented Dec 9, 2021

Description

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 the utilitiesRow variable now returns this <form>.
I have assigned a name attribute of utilities-form to the <form>.

Before:

image

After:

image

Testing Change

  1. Save a login credential on the website on google chrome
  2. Open settings to check whether the username is autofilled on click in room filter search and password for the security field.

Resolves #380

Signed-off-by: Aaryan Gautam [email protected]

Copy link
Contributor

@bwindels bwindels left a 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"}, [
Copy link
Contributor

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 <[email protected]>

Copy link
Contributor

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"}, [
Copy link
Contributor

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?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chrome Autofills Security Key
3 participants