From 348782eab7982c32615fb0526ac5c253e608f0e0 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 14 May 2019 16:07:32 +0200 Subject: [PATCH 1/2] FIX --- .../src/ScrollArea/ScrollArea.stories.tsx | 17 ++++++- lib/components/src/ScrollArea/ScrollArea.tsx | 2 + .../src/ScrollArea/ScrollAreaStyles.tsx | 50 +++++-------------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/lib/components/src/ScrollArea/ScrollArea.stories.tsx b/lib/components/src/ScrollArea/ScrollArea.stories.tsx index 93e558795458..349024ae9ce2 100644 --- a/lib/components/src/ScrollArea/ScrollArea.stories.tsx +++ b/lib/components/src/ScrollArea/ScrollArea.stories.tsx @@ -17,8 +17,8 @@ const Block = styled.span({ const Wrapper = styled.div({ whiteSpace: 'nowrap', lineHeight: '0px', - maxWidth: 500, - maxHeight: 500, + width: 500, + height: 500, overflow: 'hidden', }); @@ -70,3 +70,16 @@ export const both = () => ( ))} ); + +export const withOuterBorder = () => ( + +
+ +); diff --git a/lib/components/src/ScrollArea/ScrollArea.tsx b/lib/components/src/ScrollArea/ScrollArea.tsx index c95b5c6fffa7..10a289b64e64 100644 --- a/lib/components/src/ScrollArea/ScrollArea.tsx +++ b/lib/components/src/ScrollArea/ScrollArea.tsx @@ -21,6 +21,7 @@ const Scroll = styled(({ vertical, horizontal, ...rest }: ScrollProps) => !horizontal @@ -29,6 +30,7 @@ const Scroll = styled(({ vertical, horizontal, ...rest }: ScrollProps) => Interpolation = (theme: Them justifyContent: 'flex-start', alignContent: 'flex-start', alignItems: 'flex-start', - width: 'inherit', - height: 'inherit', - maxWidth: 'inherit', - maxHeight: 'inherit', }, '.simplebar-wrapper': { @@ -39,7 +35,6 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them '.simplebar-offset': { direction: 'inherit !important' as 'inherit', - boxSizing: 'inherit !important' as 'inherit', resize: 'none !important' as 'none', position: 'absolute', top: 0, @@ -51,18 +46,11 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them WebkitOverflowScrolling: 'touch', }, - '.simplebar-content': { + '.simplebar-content-wrapper': { direction: 'inherit', - boxSizing: 'border-box !important' as 'border-box', position: 'relative', display: 'block', - height: - '100% /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */', - width: 'auto', visibility: 'visible', - overflow: 'scroll', - maxWidth: '100% /* Not required for horizontal scroll to trigger */', - maxHeight: '100% /* Needed for vertical scroll to trigger */', }, '.simplebar-placeholder': { @@ -73,7 +61,6 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them }, '.simplebar-height-auto-observer-wrapper': { - boxSizing: 'inherit !important' as 'inherit', height: '100%', width: 'inherit', maxWidth: 1, @@ -91,7 +78,6 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them }, '.simplebar-height-auto-observer': { - boxSizing: 'inherit', display: 'block', opacity: 0, position: 'absolute', @@ -112,36 +98,39 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them right: 0, bottom: 0, pointerEvents: 'none', + overflow: 'hidden', + }, + + '[data-simplebar].simplebar-dragging .simplebar-track': { + pointerEvents: 'all', }, '.simplebar-scrollbar': { position: 'absolute', right: 2, - width: 6, + width: 7, minHeight: 10, }, '.simplebar-scrollbar:before': { position: 'absolute', content: '""', - borderRadius: 6, + background: 'black', + borderRadius: 7, left: 0, right: 0, opacity: 0, transition: 'opacity 0.2s linear', - background: theme.base === 'light' ? theme.color.darkest : theme.color.lightest, }, '.simplebar-track .simplebar-scrollbar.simplebar-visible:before': { - /* When hovered, remove all transitions from drag handle */ - opacity: 0.2, + opacity: 0.5, transition: 'opacity 0s linear', }, '.simplebar-track.simplebar-vertical': { top: 0, - width: 10, - right: 0, + width: 11, }, '.simplebar-track.simplebar-vertical .simplebar-scrollbar:before': { @@ -151,8 +140,7 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them '.simplebar-track.simplebar-horizontal': { left: 0, - height: 10, - bottom: 0, + height: 11, }, '.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before': { @@ -165,26 +153,14 @@ export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Them right: 'auto', left: 0, top: 2, - height: 6, + height: 7, minHeight: 0, minWidth: 10, width: 'auto', }, - /* Rtl support */ '[data-simplebar-direction="rtl"] .simplebar-track.simplebar-vertical': { right: 'auto', left: 0, }, - - '.hs-dummy-scrollbar-size': { - direction: 'rtl', - position: 'fixed', - opacity: 0, - visibility: 'hidden', - height: 500, - width: 500, - overflowY: 'hidden', - overflowX: 'scroll', - }, }); From a3576cb7a96f834c866b21bd29b7458c830218d6 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 14 May 2019 16:59:20 +0200 Subject: [PATCH 2/2] FIX snapshots --- .../__snapshots__/A11YPanel.test.js.snap | 78 +++++------ .../addon-info.stories.storyshot | 8 ++ .../__snapshots__/storyshots.test.js.snap | 127 ++++++++++++++++-- .../syntaxhighlighter.stories.storyshot | 12 ++ .../tabs/__snapshots__/tabs.stories.storyshot | 6 + .../__snapshots__/panel.stories.storyshot | 1 + .../__snapshots__/preview.stories.storyshot | 2 + .../__snapshots__/about.stories.storyshot | 5 + 8 files changed, 189 insertions(+), 50 deletions(-) diff --git a/addons/a11y/src/components/__snapshots__/A11YPanel.test.js.snap b/addons/a11y/src/components/__snapshots__/A11YPanel.test.js.snap index fd6ba69231f6..491016a4c4a7 100644 --- a/addons/a11y/src/components/__snapshots__/A11YPanel.test.js.snap +++ b/addons/a11y/src/components/__snapshots__/A11YPanel.test.js.snap @@ -105,7 +105,9 @@ exports[`A11YPanel should render loader when it's running 1`] = ` exports[`A11YPanel should render report 1`] = ` .emotion-0 { overflow-y: auto; + height: 100%; overflow-x: auto; + width: 100%; } .emotion-4 { @@ -215,7 +217,6 @@ exports[`A11YPanel should render report 1`] = ` "110qmus": true, "1551xjo": true, "15paq49": true, - "176o2y5": true, "1977chw": true, "19mcg9j": true, "1ez3l8h": true, @@ -225,6 +226,7 @@ exports[`A11YPanel should render report 1`] = ` "1vwgrhn": true, "4ryd4s": true, "6hqipu": true, + "6z0ulf": true, "animation-u07e3c": true, "aq4p19": true, "fg630j": true, @@ -241,9 +243,9 @@ exports[`A11YPanel should render report 1`] = ` "key": "css", "nonce": undefined, "registered": Object { - "emotion-0": "overflow-y:auto;overflow-x:auto;", "css-1977chw": "height:10px;width:10px;min-width:10px;color:#999999;margin-right:10px;transition:transform 0.1s ease-in-out;align-self:center;display:inline-flex;", "css-1l7fvsg": "height:12px;width:12px;margin-right:4px;", + "emotion-0": "overflow-y:auto;height:100%;overflow-x:auto;width:100%;", "css-jb2puo": "height:12px;width:12px;margin-right:4px;animation:animation-u07e3c 1s linear infinite;;", "css-tkevr6": "display:flex;align-items:center;justify-content:center;height:100%;", }, @@ -254,7 +256,7 @@ exports[`A11YPanel should render report 1`] = ` data-emotion="css-global" > - [data-simplebar]{position:relative;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;width:inherit;height:inherit;max-width:inherit;max-height:inherit;} + [data-simplebar]{position:relative;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;} ,