I have a strange problem just cropped up where my input fields won’t receive focus when clicking them with the mouse.
I’m using ElmUI, but have also replaced the ElmUI fields with
Html.input fields, and I get the same behaviour.
If I hover the mouse over the fields the mouse cursor changes to the vertical carat bar as would be expected.
If I add code to change styling on mouseOver, the styling changes as expected.
Browser.Dom.setFocus, then the fields receive focus, and will accept text typed by the user.
Tab between the fields, they receive focus, and will accept text typed by the user.
But the one thing they won’t do is receive focus when clicked on
Has anyone come across this sort of problem before? Any ideas on where I start?
Edit: Once the field has been given focus with
setFocus, clicking outside the field does not cause it to lose focus as would be expected.
Edit: This is an SPA that originally followed the elm-spa example with the
Model as a
Type that has branches for each page. I’ve just refactored it to use a flat model instead, and this is where this problem has arisen. So it appears that I’ve done something during the refactoring to cause this, but I don’t see what I could have done to prevent an
InputField from receiving focus when clicked on - I couldn’t test until it was all wired up again, and I haven’t touched any of the view code.