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

Html.input [ onInput Msg ] doesn't dispatch messages when a browser plugin add dom elements on top of it #199

Open
jcornaz opened this issue Oct 19, 2019 · 2 comments

Comments

@jcornaz
Copy link

jcornaz commented Oct 19, 2019

Hello,

Using the example provided in the doc: https://elm-lang.org/examples/forms

Text fields are messed up and totally unusable. Most of the time, just nothing happen, and some other time the value goes to another field...

I found a work around: Wrap the input into a div.

So changing viewInput implementation from:

viewInput t p v toMsg =
  input [ type_ t, placeholder p, value v, onInput toMsg ] []

To:

viewInput t p v toMsg =
  div [] [ [ input [ type_ t, placeholder p, value v, onInput toMsg ] [] ]

Solves the problem. (however, also change the render...)

I'm using:

  • Chrome 77.0.3865.120
  • Linux 5.3.6-1-MANJARO x86_64

(Note that it is not an issue of the online sandbox. I get the same problem when compiling locally)

UPDATE: It works well on firefox

UPDATE2: It does not work better on firefox. It is caused by a browser plugin that add new dom elements on top of said input field

@zwilias
Copy link
Member

zwilias commented Oct 21, 2019

It works fine for me on that exact same version of Chrome on OSX.

Can you check if you have any extensions enabled that might be messing with the DOM? Assuming you haven't set any extensions to be enabled in private browsing mode, can you verify that this also breaks for you when using private browsing mode?

@jcornaz
Copy link
Author

jcornaz commented Oct 22, 2019

@zwilias

Yes! I found that the 1password plugin is problematic.

It worked with firefox only because I didn't have the plugin installed on it. But I just reproduced the same problem using Firefox.

It is very problematic though. It is the first time I have a problem due to that plugin. It works quite well with every site. And creating a register/login form while saying to the user : "You cannot use a password bank" is really a no go for me. I know not all password banks need a plugin that touch the dom. But the most user-friendly ones do...

@jcornaz jcornaz changed the title Html.input [ onInput Msg ] does not dispatch the message Html.input [ onInput Msg ] doesn't dispatch messages when a browser plugin add dom elements on top of it Oct 23, 2019
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

2 participants