Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
FLOW-1162 scrollbar issue fixed in chrome v121 (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr authored Jan 25, 2024
1 parent 686e38a commit 8a613f4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
14 changes: 14 additions & 0 deletions packages/flow-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

# Change Log

## [2.7.8] - 2024-01-25

### Improvements

- Added `show-scrollbar` property to `f-div`.

### Bug Fixes

- Updated `f-div` to accommodate changes in Chrome v121, which now supports the `scrollbar-width` property. Default behavior adjusted accordingly.

### Note

- Removed `hide-scrollbar` property from `f-div`. Existing usage won't cause any issues.

## [2.7.7] - 2024-01-22

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ollion/flow-core",
"version": "2.7.7",
"version": "2.7.8",
"description": "Core package of flow design system",
"module": "dist/flow-core.es.js",
"main": "dist/flow-core.cjs.js",
Expand Down
9 changes: 5 additions & 4 deletions packages/flow-core/src/components/f-div/f-div-global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ f-div {
z-index: 1001; /* set a higher z-index for the highlighted div to place it above the overlay */
}

&[hide-scrollbar] {
-ms-overflow-style: none; /* Internet Explorer 10+ */
scrollbar-width: none; /* Firefox */
&[show-scrollbar] {
scrollbar-width: thin;

&::-webkit-scrollbar {
display: none; /* Safari and Chrome */
display: block;
width: 6px;
height: 6px;
}
}
// iterating over states and appyling respective css
Expand Down
4 changes: 2 additions & 2 deletions packages/flow-core/src/components/f-div/f-div.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ export class FDiv extends FRoot {
/**
* @attribute set true when to hide scrollbar
*/
@property({ reflect: true, type: Boolean, attribute: "hide-scrollbar" })
hideScrollbar?: boolean = false;
@property({ reflect: true, type: Boolean, attribute: "show-scrollbar" })
showScrollbar?: boolean = false;

/**
* @attribute Overflow property defines the behavior of the overflowing elements inside a f-div
Expand Down
5 changes: 2 additions & 3 deletions packages/flow-core/src/mixins/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@

@mixin scrollbar() {
&::-webkit-scrollbar {
width: 6px;
height: 6px;
display: none;
}
&::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 2px transparent;
background-color: transparent;
}
scrollbar-color: var(--color-neutral-default) transparent;
scrollbar-width: thin;
scrollbar-width: none;
&::-webkit-scrollbar-thumb {
background-color: var(--color-neutral-default);
}
Expand Down
10 changes: 5 additions & 5 deletions stories/flow-core/f-div.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1348,10 +1348,10 @@ export const Selected = {
name: "selected"
};

export const HideScrollbar = {
export const ShowScrollbar = {
render: () =>
html` <f-text state="secondary"
>default behaviour when content overflows, it shows scrollbar</f-text
>default behaviour when content overflows, scrollbar is hidden</f-text
>
<f-div gap="medium" direction="column" padding="medium" height="200px" direction="row">
<f-text
Expand Down Expand Up @@ -1384,11 +1384,11 @@ export const HideScrollbar = {
<br /><br />
<f-divider></f-divider>
<br /><br />
<f-text>hide-scrollbar is set (Note: Users can still scroll through the content.)</f-text>
<f-text>show-scrollbar is set (Note: Users can still scroll through the content.)</f-text>
<f-div
gap="medium"
direction="column"
hide-scrollbar
show-scrollbar
padding="medium"
height="200px"
direction="row"
Expand Down Expand Up @@ -1421,7 +1421,7 @@ export const HideScrollbar = {
>
</f-div>`,

name: "hide-scrollbar"
name: "show-scrollbar"
};

export const Loading = {
Expand Down

0 comments on commit 8a613f4

Please sign in to comment.