-
Notifications
You must be signed in to change notification settings - Fork 975
prevent Dialog from being uncloseable with long text #8475
Conversation
@cezaraugusto @bradleyrichter Can we consider making only the body text scrollable (when it hits a max-height), so the dialog button is always visible? Making the user scroll down to dismiss the dialog seems unnecessary. |
Personally I wouldn't go with a full width (90%), but limit it to I don't know maybe max 300, 400px (completely random number from the top of my head 😃 ) |
@jonathansampson that's a great idea. I'll wait for design feedback from Brad and do all together, thanks for reviewing |
@NejcZdovc thanks, yep I did a random guess as well |
Agree with @NejcZdovc that we need a max-width, or a fixed-width. |
+1 unless the title could be so long that it would overflow the dialog. |
'::-webkit-scrollbar-thumb': { | ||
background: globalStyles.color.braveOrange, | ||
// same as primary button | ||
boxShadow: '0px 1px 5px -1px rgba(0, 0, 0, 0.5)', |
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.
let's replace the box-shadow with a variable on global.js for future use :-)
borderRadius: '4px' | ||
}, | ||
'::-webkit-scrollbar-track': { | ||
boxShadow: 'inset 0 0 4px rgba(0,0,0, 0.3)', |
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.
ditto.
+++
… On Apr 25, 2017, at 3:51 AM, Suguru Hirahara ***@***.***> wrote:
@luixxiul commented on this pull request.
In app/renderer/components/styles/commonStyles.js:
> + top: globalStyles.spacing.dialogTopOffset,
+ // Issue #7930
+ overflowY: 'auto',
+ overflowX: 'hidden',
+ maxWidth: '90%',
+ maxHeight: '90%',
+ boxSizing: 'border-box',
+
+ // Add a custom scrollbar for the element
+ '::-webkit-scrollbar': {
+ width: '10px'
+ },
+ '::-webkit-scrollbar-thumb': {
+ background: globalStyles.color.braveOrange,
+ // same as primary button
+ boxShadow: '0px 1px 5px -1px rgba(0, 0, 0, 0.5)',
let's replace the box-shadow with a variable on global.js for future use :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
771c65c
to
633987e
Compare
Updated, set a smaller size and migrated scroll to body |
Isn't the scroll bar too low contrasted? |
contrast looks good for me but I don't mind changing it |
@cezaraugusto Looks really great! Can we do anything about making sure it isn't taller than the window? |
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.
Everything looks good, and works well. I had one suggestion to further improve, but I still think this is ship-ready.
@@ -154,7 +158,10 @@ const styles = StyleSheet.create({ | |||
marginTop: globalStyles.spacing.dialogInsideMargin, | |||
minWidth: '425px', | |||
marginBottom: globalStyles.spacing.dialogInsideMargin, | |||
userSelect: 'text' | |||
userSelect: 'text', | |||
maxHeight: '300px', |
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.
what if we would apply vh
instead of px
? 300px might be small for full HD monitors. Please see about:error page for examples.
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.
Oh, good idea @luixxiul with vh
. Since dialogs are pretty much always sized and positioned relatively to the viewport, it makes sense to use vh
and vw
. What do you think, @cezaraugusto?
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.
that's great, I took a look at other browsers and they take that approach as well. Maybe 80vh is good enough?
// Issue #7930 | ||
boxSizing: 'border-box', | ||
maxWidth: '600px', | ||
maxHeight: '500px' |
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.
ditto
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.
After some thought, I think it would be desirable to use the native scrollbar on each platform so that users recognize it as being a standard control used by the OS.
633987e
to
8da5411
Compare
PR updated with custom scrollbar removal. New STR and preview here: #8475 (comment) |
@@ -110,7 +110,7 @@ const globalStyles = { | |||
buttonHeight: '25px', | |||
buttonWidth: '25px', | |||
navbarHeight: '36px', | |||
downloadsBarHeight: '50px', |
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.
looking at the component and at variables.less it actually never was 50px
Just pulled down the changes; beautiful work, @cezaraugusto! |
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.
Awesome work, @cezaraugusto! This looks and feels great 😄
git rebase -i
to squash commits (if needed).Screenshot:
/cc @bradleyrichter for design review
Test Plan: