Skip to content

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

Open
aaryan-gautam wants to merge 2 commits into
element-hq:masterfrom
aaryan-gautam:master
Open

Fixed autocomplete bug by enclosing div within a form tag #380#616
aaryan-gautam wants to merge 2 commits into
element-hq:masterfrom
aaryan-gautam:master

Conversation

@aaryan-gautam
Copy link
Copy Markdown

@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 aaryanyo123@gmail.com

Copy link
Copy Markdown
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

}
));
const utilitiesRow = t.div({className: "utilities"}, [
const utilitiesRow = t.form({name:"utilities-form"}, [
Copy link
Copy Markdown
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 <bruno@windels.cloud>

Copy link
Copy Markdown
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

}
));
const utilitiesRow = t.div({className: "utilities"}, [
const utilitiesRow = t.form({name:"utilities-form"}, [
Copy link
Copy Markdown
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?

Copy link
Copy Markdown

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