mdgriffith / style-elements

Create styles that don't mysteriously break!
http://package.elm-lang.org/packages/mdgriffith/style-elements/latest
BSD 3-Clause "New" or "Revised" License
445 stars 49 forks source link

Input.text not clearing from external event #98

Closed tuxagon closed 7 years ago

tuxagon commented 7 years ago

Hello! I encountered an issue with Input.text and it could be isolated or a bigger issue. Ultimately, what I was trying to do was create a textbox and allow it to be cleared via some external action like a button click.

Here is a SSCCE of the problem https://ellie-app.com/b75NcBq9sa1/0

When I clicked the button, it did not clear. I presumed, since the { ... value : String ... } field is just fed the value, that the text box would change, but it did not.

Edit: It was mentioned in slack to use the textKey option, but the cursor started jumping out after every button press. It should be mentioned that the textbox cleared with that option, however.

Here is an updated SSCCE using textKey https://ellie-app.com/XPsQCptha1/0

This should probably be related to #91

eniac314 commented 7 years ago

I think you need to update the counter in the ClearText branch, not in the EditText branch. https://ellie-app.com/rtzcXCkH3a1/0

tuxagon commented 7 years ago

Ah, that was not obvious. Thanks!