-
Notifications
You must be signed in to change notification settings - Fork 145
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
input type not dynamic #283
Comments
You should use |
Thanks for pushing me to the source, so now I have my eye-featured password field. Regarding Nevertheless, I cannot think of a valid application of the rewrite interpretation of the So, if we don't come up with a counter example where rewriting the dynamic attribute is an expected / wanted feature, I would propose a breaking back compatibility change with a fallback interpretation of the |
@paolino actually the @luigy perhaps |
It seems to me that if you're changing the type of the input, you should probably wrap the whole thing in some kind of |
@paolino can you post the workaround for the problem? I agree the current implementation of |
I'm working on something else now, so I hope I'm pasting the right snippet
eh.
1. passwordInput :: (MS m, DomBuilderSpace m ~ GhcjsDomSpace)
2. => Bool -> DS Bool -> m (TextInput Spider)
3. passwordInput t seeD = do
4. let dAttr = fmap (("autocomplete" =: if t then "new-password" else
"current-password") <>) $ ffor seeD $ \case
5. True -> "type" =: "password"
6. False -> "type" =: "text"
7. modifyAttrs <- dynamicAttributesToModifyAttributes $ dAttr
8. i <- inputElement $ def
9. & inputElementConfig_elementConfig . elementConfig_modifyAttributes
10. .~ fmap mapKeysToAttributeName modifyAttrs
11. return $ TextInput
12. { _textInput_value = _inputElement_value i
13. , _textInput_input = _inputElement_input i
14. , _textInput_keypress = domEvent Keypress i
15. , _textInput_keydown = domEvent Keydown i
16. , _textInput_keyup = domEvent Keyup i
17. , _textInput_hasFocus = _inputElement_hasFocus i
18. , _textInput_builderElement = i
19. }
Best
…On Wed, 26 Jun 2019 at 16:57, Denis Redozubov ***@***.***> wrote:
@paolino <https://github.com/paolino> can you post the workaround for the
problem? I agree the current implementation of textInput looks completely
broken in regard of it bluntly overwriting the textInputConfig_inputType
value.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#283?email_source=notifications&email_token=AAANYHUPMM3S7OVPHVAS4HTP4N7V7A5CNFSM4GRJEE72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYTZ6NI#issuecomment-505913141>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAANYHTTQMKEEO3RXYAZOT3P4N7V7ANCNFSM4GRJEE7Q>
.
--
Paolo Veronelli ([email protected])
*Functional developer @ global.de <http://global.de/>*
|
That's what I did as well, thanks. |
Trying to add the classic switch from visible to invisible password field. The dynamic attributes are not controlling the "type" attribute.
The text was updated successfully, but these errors were encountered: