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

Any disable api? #28

Closed
ido1wald opened this issue Apr 5, 2018 · 5 comments
Closed

Any disable api? #28

ido1wald opened this issue Apr 5, 2018 · 5 comments

Comments

@ido1wald
Copy link

ido1wald commented Apr 5, 2018

The disable props on the button is kinda buggy.
Any other solution?

@ido1wald ido1wald closed this as completed Apr 5, 2018
@arnthor3
Copy link
Owner

arnthor3 commented Apr 5, 2018

What kind of a browser are you using? I admit I only test in Chrome and Firefox.
In what way is it buggy?

I think you could just return false from the onclick handler to at least not toggle the states.

If you give me a better description I can check this out tonight.

@ido1wald
Copy link
Author

ido1wald commented Apr 8, 2018

Thanks for your comment, I've closed the report since it's irrelevant.
The bug is when you're using the ToggleButton with react bootstrap tabs, the ToggleButton can't find it's css height so it turns out bad and "buggy"
The solution is to update the ToggleButton component after the ToggleButton's tab was selected

@arnthor3
Copy link
Owner

arnthor3 commented Apr 8, 2018

Ah, I understand. It's rendered with no dimensions and when the visibility is toggled it does not recalculate the width and height.
I will add resize observer to the toggle as a prop.

<Toggle 
  {...restOfProps}
  recalculateOnResize={true}
/>

That way you don't have to manually update the component.

@arnthor3 arnthor3 reopened this Apr 8, 2018
@ido1wald
Copy link
Author

ido1wald commented Apr 8, 2018

That's really nice :)
I just added a style tag to the component to have a fixed size such as

<Toggle 
style = { {height: "100px", width: "100px" }} 
/>

Thanks for all the effort :)

@arnthor3
Copy link
Owner

arnthor3 commented Apr 8, 2018

Just released 2.3.0, it does include the resize prop. I am going to leave this open until I have updated the tests accordingly. Thanks for the catch.

@arnthor3 arnthor3 reopened this Apr 8, 2018
@arnthor3 arnthor3 closed this as completed Mar 4, 2019
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

2 participants