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

[Dialog] clear deprecated api #2396

Merged
merged 2 commits into from
Dec 7, 2015

Conversation

alitaheri
Copy link
Member

@oliviertassinari I had to remove isOpen() since it makes no sense now. And defaultOpen, I don't think there really is a use-case for this. therefore I made open required. do you think we should ease into this or YOLO?!

@alitaheri alitaheri added this to the Declarative API milestone Dec 6, 2015
@oliviertassinari
Copy link
Member

Looks good. What should we do with the DatePicker? https://github.com/subjectix/material-ui/blob/dialog-clear-deprecated-api/src/date-picker/date-picker-dialog.jsx#L162
I think that having a controllabled DatePicker would be a good idea.

@alitaheri
Copy link
Member Author

Is there any case for uncontrolled DatePicker or TimePicker?
Well for now they will be noop. I guess we should make other PRs to address them too.

@oliviertassinari
Copy link
Member

I think that uncontrolled DatePicket and TimePicker makes sense.
However, in my app, I'm using a controlled one.
I'm hacking the interface for them to be controlled.
For instance, I need to close the DatePicker when the user navigate back.
I guess I'm not the only one to do so.
I think that we should create another PR before merging this.
What do you think?

@alitaheri
Copy link
Member Author

I think that uncontrolled DatePicket and TimePicker make sense... for them to be controlled...

@oliviertassinari I'm confused O.o

@oliviertassinari
Copy link
Member

What I mean is that controlled and uncontrolled are two valid use case.

@alitaheri
Copy link
Member Author

@oliviertassinari I see. In that case, sure. But let's not introduce breaking changes right now to those components. I'll try to patch them up within this PR before merging. sounds good? Later on we'll deprecate those props and cover the use-cases in a more convenient way.

@oliviertassinari
Copy link
Member

I'll try to patch them up within this PR before merging

Sounds awesome!

@@ -193,12 +183,14 @@ const DatePickerDialog = React.createClass({
},

show() {
if (this.props.onShow && !this.state.open) this.props.onShow();
Copy link
Member Author

Choose a reason for hiding this comment

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

the !this.state.open makes sure show (and dismiss) events are only fired once. prevents consecutive dispatch when going berserk with clicks!

@alitaheri alitaheri force-pushed the dialog-clear-deprecated-api branch from e1c9dc3 to 921d06a Compare December 7, 2015 07:34
@alitaheri
Copy link
Member Author

@oliviertassinari Is this ok? I think it's better not to rebase, the second commit indicates exactly why those lines where removed and added.

@oliviertassinari
Copy link
Member

Looks fine :).

alitaheri added a commit that referenced this pull request Dec 7, 2015
@alitaheri alitaheri merged commit d5bbcad into mui:master Dec 7, 2015
@alitaheri alitaheri deleted the dialog-clear-deprecated-api branch December 7, 2015 08:21
alitaheri added a commit to alitaheri/material-ui that referenced this pull request Dec 7, 2015
@adambro
Copy link

adambro commented Dec 13, 2015

How about releasing new version to NPM? Currently DatePicker is broken in 0.14.0-rc1 version.

@alitaheri alitaheri modified the milestone: Declarative API Dec 23, 2015
@zannager zannager added the component: dialog This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants