Skip to content

Conversation

@gsavvid
Copy link
Contributor

@gsavvid gsavvid commented Mar 23, 2017

On Android there's the need of preventing spinner from hiding when pressing the hardware back button. This can be resolved by setting the new prop cancelable to false -by default it's true.

This has no effect on iOS as the Modal's onRequestClose prop is Android-specific.


static defaultProps = {
visible: false,
cancelable: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

@niftylettuce WDYT? IMO, this should be false by default to not introduce a braking change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@SandroMachado I agree, should be false and we should update Readme too if it isn't already

Copy link
Contributor

Choose a reason for hiding this comment

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

True. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@niftylettuce @SandroMachado The native Android Dialog has a setCancelable method. Since the new prop that I've added here only applies for Android, I thought it makes sense to name it after the native one. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, probably the only thing I would change it is from true to falsein the default value of the prop. To be disable by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SandroMachado @niftylettuce There are 2 main reasons I would vote against setting the default value to false:

  1. By setting the default value to false you will introduce a change since currently the spinner is cancelable. Therefore users who will get the update and want to keep the same behavior as the current version would have to explicitly set cancelable:true.
  2. The native Android Dialog is by default cancelable.

If you still insist, I can change it though.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gsavvid you are right. Can you please only update the README.md with this new prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SandroMachado I took the liberty to re-organize a bit the props part in the Readme.md file by showing them all in a table, ordered alphabetically.

One thing I also updated in the documentation is that -according to the source code- the size prop supports normal but only small and large was documented.

If you don't want these changes, I can revert the commit and simply add a new bulletin with the cancelable prop.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@SandroMachado SandroMachado left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 👍

@SandroMachado SandroMachado merged commit 6b98279 into ladjs:master Apr 4, 2017
@niftylettuce
Copy link
Collaborator

@SandroMachado did you want to version bump and release new version to NPM? I can if you need, thanks - just let me know. 🎉

@SandroMachado
Copy link
Contributor

@niftylettuce if you have time, please do it. I can only do the release later today.

@niftylettuce
Copy link
Collaborator

released 0.4.3

@niftylettuce
Copy link
Collaborator

I unpublished 0.4.3 - I have published 0.4.4 with a default of false for cancelable. The intent of this loading spinner is to prevent a user from being able to do any other action in the app while it is loading. Even though this is a breaking change, on iOS (the platform that is the standard base) doesn't allow it to hide. See 0.4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants