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

Button types #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Button types #17

wants to merge 2 commits into from

Conversation

3noch
Copy link
Member

@3noch 3noch commented Jul 1, 2017

Buttons are submits by default which is a very odd thing indeed in a Reflex app.

@@ -124,14 +137,16 @@ uiButtonAttrs UiButton{..} = T.unwords $ catMaybes
-- provided by other functions such as 'uiButtonAnimated'.
uiButton
:: MonadWidget t m
=> Dynamic t UiButton
=> UiButtonType
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

@3noch 3noch Jul 3, 2017

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

@3noch
Copy link
Member Author

3noch commented Oct 11, 2017

Sorry, I still plan to do this but my project is hightailing it to production so I have little time for OSS contributions ATM.

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

Successfully merging this pull request may close these issues.

2 participants