-
Notifications
You must be signed in to change notification settings - Fork 10
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
Button types #17
base: master
Are you sure you want to change the base?
Button types #17
Conversation
@@ -124,14 +137,16 @@ uiButtonAttrs UiButton{..} = T.unwords $ catMaybes | |||
-- provided by other functions such as 'uiButtonAnimated'. | |||
uiButton | |||
:: MonadWidget t m | |||
=> Dynamic t UiButton | |||
=> UiButtonType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing this type signature, can you put UiButtonType
inside the UiButton
type instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of that but it seems very odd to change the type of a button dynamically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Then I think if we're making a breaking change we should go for a more general one:
uiButton :: MonadWidget t m => UiButtonStatic -> Dynamic t UiButton ...
...and make UiButtonType be a field of UiButtonStatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm cool with that. I could also add new functions like uiButtonWith
and have uiButton
et. al. default to the most common use-case (in Reflex apps that is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
Sorry, I still plan to do this but my project is hightailing it to production so I have little time for OSS contributions ATM. |
Buttons are submits by default which is a very odd thing indeed in a Reflex app.