Skip to content

Commit

Permalink
Merge pull request #174 from lana/fix-carousel-scroll-for-systems-usi…
Browse files Browse the repository at this point in the history
…ng-display-scaling

Fix Carousel behavior for system using display scaling
  • Loading branch information
José Ortiz authored Sep 14, 2021
2 parents ab21742 + ee1b380 commit deb3e9d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lana/b2c-mapp-ui",
"version": "8.32.1",
"version": "8.32.2",
"description": "Shared custom libraries for building µapps.",
"bugs": {
"url": "https://github.com/lana/b2c-mapp-ui/issues"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActionItem/ActionItem.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ActionItem from './ActionItem.vue';
import RenderString from '../../lib/renderString';
import { createDeviceDecorator } from '../../lib/storybookHelpers';

const deviceDecorator = createDeviceDecorator('<strong>ContentRadioList:</strong> A control that allows a user to select an option by showing all available options as a list of radio buttons.');
const deviceDecorator = createDeviceDecorator('<strong>ActionItem:</strong>&nbsp;A list item which takes the user to perform an action in another screen.');

const ActionItemStories = {
component: ActionItem,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Carousel/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ const methods = {
},
handleScroll(event) {
const { scrollLeft, clientLeft } = event.target;
const roundedScrollLeft = Math.round(scrollLeft) + clientLeft;
const index = this.items.findIndex(({ offsetLeft: itemOffsetLeft }) => (itemOffsetLeft === roundedScrollLeft));
const correctedScrollLeft = scrollLeft + clientLeft;
const index = this.items.findIndex(({ offsetLeft: itemOffsetLeft }) => (Math.abs(itemOffsetLeft - correctedScrollLeft) < 1));
if (index < 0) { return; }
if (this.destinationScrollLeft !== null && this.items[index].offsetLeft !== this.destinationScrollLeft) { return; }
this.destinationScrollLeft = null;
Expand Down
8 changes: 4 additions & 4 deletions src/components/ToggleSwitch/ToggleSwitch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
margin-right: 16px;
}

.toggle-button ::v-deep {
.button.toggle-button {
color: $black-700;
font-weight: 500;
font-size: 16px;
border: 1px solid $black-300;
border-radius: 8px;
}

.focused ::v-deep {
border: 1px solid $blue-600;
&.focused {
border: 1px solid $blue-600;
}
}

0 comments on commit deb3e9d

Please sign in to comment.