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

Label overlaps with default value on Form Reset (fix suggested) #6409

Open
eulores opened this issue Jul 10, 2019 · 0 comments
Open

Label overlaps with default value on Form Reset (fix suggested) #6409

eulores opened this issue Jul 10, 2019 · 0 comments

Comments

@eulores
Copy link

eulores commented Jul 10, 2019

When resetting the form, the label overlaps the provided default text. No change in behaviour even after adding class="active" to the label element.

There are several related issues. I checked them but they are not quite the same or based on outdated versions. (open issue #5051)

Here is a very reduced test case:
https://codepen.io/eulores/pen/EBrydy

I expect the label not to overwrite the text when resetting the form.

Possible Solution

In the javascript file forms.js, in the function triggered on form reset, do these two changes:

  1. Remove the code that removes the class 'active' from all label elements.
  2. Add a call to M.updateTextFields() in the timeout function that triggers immediately after the native form reset.

Steps to Reproduce (for bugs)

See Codepen sample code.

My Environment

I tried and saw same behaviour with Firefox, Chrome and Edge browsers.
Materialize version 1.0.0

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

No branches or pull requests

1 participant