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

Solution for hiding a disabled button #60

Open
Gys opened this issue Jan 13, 2017 · 4 comments
Open

Solution for hiding a disabled button #60

Gys opened this issue Jan 13, 2017 · 4 comments

Comments

@Gys
Copy link

Gys commented Jan 13, 2017

Maybe this is useful to others as well. Its a style that I use to hide buttons that are disabled. I use it for disabledStyle.
The hidden button will still take a little space though. Not sure why.

    buttonDisabled: {
      width: 1, 
      height: 1,
      margin: 0, 
      borderColor: 'rgba(0,0,0,0)', // transparent
      backgroundColor: 'rgba(0,0,0,0)'
    }

@Gys
Copy link
Author

Gys commented Jan 13, 2017

Adding bottomMargin: -2 solves the problem with spacing. The button will be completely gone.

@stonepreston
Copy link

@Gys i dont think negative margins work on android, so you might be careful about using that if you are targeting both platforms

@Gys
Copy link
Author

Gys commented Jan 14, 2017

Thanks for the warning. So I just now tested it on a android 6.0 phone and it worked as expected (so exactly as on ios latest).

@andretf
Copy link

andretf commented Oct 6, 2018

Well, your button take a little space because you set its dimensions to 1x1. Proper way to hide it would be:

display: 'none',
borderWidth: 0 // if necessary

or, at last

position: absolute,
top: -1000

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

No branches or pull requests

3 participants