-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix: use cloneElement instead of div.openByClickOn #40
Conversation
This is great! I've been once trying to solve the exact same thing (but unsuccessfully). :-) Can you please update this PR, so it's passing Travis CI? Unfortunately, I just completely changed the whole build process (check the readme/contribution or package.json scripts). The repo was also force pushed (history cleaning). Thank you! |
merge with upstream
Can you give me an idea how to fix this test? I don't have experience with React testing, to be honest, and don't know how to use The test fails because now |
@tajo ? |
Nice. This keeps the markup more clean too. Hopefully the PR gets merged soon. Great work, @theaqua . |
Hey, @tajo, I changed spec for using |
fix: use cloneElement instead of div.openByClickOn
Looking good. Thanks! |
It's all because box model in CSS.
div
by default holds 100% width and as you see, my toggle-portal-button actually is not a button, it's adiv
.So this PR fixes it by using
React.cloneElement
for extendsthis.props.openByClickOn
-element withonClick
prop and button became a button :)