Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.31'
Browse files Browse the repository at this point in the history
  • Loading branch information
Liax committed Mar 24, 2023
2 parents bacaf3c + 0a8a670 commit 8d22064
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [v0.2.31](https://github.com/studiometa/ui/compare/0.2.30..0.2.31) (2023-03-24)

### Fixed

- **Slider:** fix buttons ([1460eb2](https://github.com/studiometa/ui/commit/1460eb2))

## [v0.2.30](https://github.com/studiometa/ui/compare/0.2.29..0.2.30) (2023-03-02)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "studiometa/ui",
"version": "0.2.30",
"version": "0.2.31",
"description": "A set of opiniated, unstyled and accessible components.",
"license": "MIT",
"require": {
Expand Down
12 changes: 6 additions & 6 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": "@studiometa/ui-workspace",
"version": "0.2.30",
"version": "0.2.31",
"private": true,
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/ui-docs",
"version": "0.2.30",
"version": "0.2.31",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/ui-playground",
"version": "0.2.30",
"version": "0.2.31",
"private": true,
"scripts": {
"dev": "meta dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/ui-tests",
"version": "0.2.30",
"version": "0.2.31",
"private": true,
"type": "module",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions packages/ui/molecules/Slider/Slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export class Slider<T extends BaseProps = BaseProps> extends Base<T & SliderProp
*/
__currentIndex = 0;

__isDragging = false;

/**
* Get the current index.
*/
Expand Down Expand Up @@ -310,6 +312,8 @@ export class Slider<T extends BaseProps = BaseProps> extends Base<T & SliderProp
onSliderDragStart() {
this.__initialX = this.currentSliderItem ? this.currentSliderItem.x : 0;
this.__distanceX = this.__initialX;

this.__isDragging = true;
}

/**
Expand All @@ -331,6 +335,11 @@ export class Slider<T extends BaseProps = BaseProps> extends Base<T & SliderProp
* Listen to the Draggable `drop` event and find the new active slide.
*/
onSliderDragDrop(props: DragServiceProps) {
if (!this.__isDragging) {
return;
}
this.__isDragging = false;

if (Math.abs(props.delta.y) > Math.abs(props.delta.x)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studiometa/ui",
"version": "0.2.30",
"version": "0.2.31",
"description": "A set of opiniated, unstyled and accessible components",
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 8d22064

Please sign in to comment.