-
Notifications
You must be signed in to change notification settings - Fork 843
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
Added restrictWidth
to EuiPage
#896
Conversation
- Breaking: the default is to max-width the page at 1000px
src/components/page/page.js
Outdated
* set to `false` to not restrict the width, | ||
* set to a number for a custom width. | ||
*/ | ||
restrictWidth: PropTypes.any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chandlerprall I'm not sure if this is particularly correct, but we want to accept either a bool or string, maybe a custom prop type, but that seemed excessive...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also do this to be a little more specific
restrictWidth: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.number
]),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh perfect, I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with the spirit of this and agree we need something. I think we might want to default to false simply to avoid the breaking change since it's a heavily used component and saves people downstream some headache (thinking about @gjones).
Right now it's really pretty split in Kibana over which pages go full width and which don't, so I think it would require an equal amount of work to maintain no matter which was the default.
Thanks for bringing attention to this @snide, yeah I’d definitely agree with setting this prop to false default. Other than adding more work on our end, I’m not sure I personally agree with the library being so opinionated on such a divisive size. Although I trust and leave those decisions to your team. |
That's fine, I'll set the default to "false". I was mainly thinking of Kibana where most of the implementation so far have needed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested for functionality. Works as advertised. Code looks good. 👍
and fixing strings to be numbers
Sets the max-width of the page, set to
true
to use the default size, set tofalse
to not restrict the width (default), set to a number for a custom width.You can see the change in the Doc
app_view.js
.