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

Inner most wrapping div cannot be styled #4

Closed
darcyadams opened this issue May 7, 2019 · 8 comments · Fixed by #5
Closed

Inner most wrapping div cannot be styled #4

darcyadams opened this issue May 7, 2019 · 8 comments · Fixed by #5
Labels

Comments

@darcyadams
Copy link

Each child component of the view slider is wrapped in a div element that receives a hard coded inline style of width: '100%'. This is problematic in certain layouts. The reason being that with no height constraint (or ability to add one) this div will grow to the size of its content. This prevents the child component from being able to fill its parent (ie height of 100%) and also have a scrolling element unless the developer is willing to put a fixed pixel height on them.
Would you consider adding another optional inline style prop to allow styles to be added to this div?

return (
      <div
        key={index}
        style={prefixer.prefix(style)}
        ref={c => (this.views[index] = c)}
      >
        <div style={{ width: '100%' }}> // <--- make this prop based?
@jedwards1211
Copy link
Member

jedwards1211 commented May 7, 2019

Sure, that's a good point. Also, can you think of a good shortcut prop name for what you're trying to do? There's already a fillParent prop that makes the view slider fill its parent (though doesn't make the child do so). Or maybe that prop should affect the innermost div too

@jedwards1211
Copy link
Member

@darcyadams does innerWrappingDivStyle sound good?

@darcyadams
Copy link
Author

@jedwards1211 thanks for the quick reply.

yeah, innerWrappingDivStyle sounds perfect. fillParent seems like a great option for those working in an absolutely positioned layout. I'm currently working in an app laid out with flexbox, so fillParent just causes the view-slider to expand to the full window size, which does not work in this case.

@jedwards1211
Copy link
Member

right, I wish there could be more of a magic one-size-fits-all solution but I sure can't think of one. I'll merge that PR

@jedwards1211
Copy link
Member

🎉 This issue has been resolved in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@darcyadams
Copy link
Author

thanks @jedwards1211 you win the award for most responsive project maintainer ever! 🏆

@darcyadams
Copy link
Author

any chance you could quickly add support in react-router-drilldown for this prop? 🙏

@jedwards1211
Copy link
Member

ah yes, that was on the back of my mind, cool that you're using that too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants