Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🚀esl-event-listener]: ability to block swipe/longwheel events for scrollable content in the "middle" state #2085

Closed
ala-n opened this issue Nov 30, 2023 · 3 comments · Fixed by #2098

Comments

@ala-n
Copy link
Collaborator

ala-n commented Nov 30, 2023

As an ESL user, I want predictable UX behavior when the native event is shared with the scroll in the area.

Use case:

<my-swipe-area>
    <!-- esl-scrollable-content or just native overflow: scroll -->
    <div class="esl-scrollable-content">
        ... some large content 
    </div>
</my-swipe-area>

Where:

class MySwipeArea extends ESLBaseElement {
    static is = 'my-swipe-area';
    
    @listen({
        event: 'swipe',
        target: ESLSwipeGestureTarget.for
    })
    onSwipe() {
        // handle swipe
    }
}

In the described example, the swipe event will be triggered each time the user swipes the area long enough. But what if the user was manipulating with the scroll / "inner" scroll...

Proposed API:

Proposed is to add an ability to filter gesture events like swipe or longwheel when they conflict with the meaningful scroll action, i.e., the pointer/focus is on the scrollable element that is not on the axis bound that relates to the gesture direction.

Note: updated property from ignoreScroll to processOverflow

ESLSwipeGestureTarget.for($el, {
    processOverflow: boolean // true by default, false if the user does not need the described type of filtering
})
@ala-n ala-n added waits triage Issue that waits to be reviewed and handled enhancement Improvements and additions to code and removed waits triage Issue that waits to be reviewed and handled labels Nov 30, 2023
@ala-n ala-n added this to the ⚡ESL: 5.1.0 Minor release milestone Dec 20, 2023
@ala-n ala-n linked a pull request Jan 22, 2024 that will close this issue
ala-n added a commit that referenced this issue Jan 29, 2024
… `swipe` events in case of content scrolling (#2098)

Closes: #2085
Co-authored-by: ala'n (Alexey Stsefanovich) <astsefanovich@exadel.com>
Co-authored-by: Dmytro Shovchko <d.shovchko@gmail.com>
Co-authored-by: Anna Barmina <52083788+abarmina@users.noreply.github.com>
ala-n pushed a commit that referenced this issue Feb 14, 2024
## [5.0.0-beta.10](v5.0.0-beta.9...v5.0.0-beta.10) (2024-02-14)

### Features

* **esl-event-listener:** ootb ability to skip custom `longwheel` and `swipe` events in case of content scrolling ([#2098](#2098)) ([ecc849f](ecc849f)), closes [#2085](#2085)
* **esl-popup:** rework esl-popup styles to use CSS variables ([cd781b9](cd781b9))

### Bug Fixes

* **microtask:** fix argument list on next fn call ([f421e88](f421e88))
* **swipe:** fix swipe tests ([e1aefb8](e1aefb8))
@ala-n
Copy link
Collaborator Author

ala-n commented Feb 14, 2024

🎉 This issue has been resolved in version 5.0.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ala-n ala-n closed this as completed in 80c5747 Apr 10, 2024
ala-n pushed a commit that referenced this issue Apr 10, 2024
# [4.16.0](v4.15.0...v4.16.0) (2024-04-10)

### Bug Fixes

* **esl-event-listener:** fix support for any object-like host ([ae4c98d](ae4c98d))
* **esl-share:** fix merging of `additional`(nested) params when `ESLShareConfig.update` method is called ([b9b4e5f](b9b4e5f))
* **esl-share:** rename copy action `alertText` param to `copyAlertMsg` ([d3e3c3a](d3e3c3a))
* **esl-utils:** fix argument list on next fn call ([c2e5c1d](c2e5c1d))

### Features

* **esl-event-listener:** ootb ability to skip custom `longwheel` and `swipe` events in case of content scrolling ([#2098](#2098)) ([80c5747](80c5747)), closes [#2085](#2085)
* **esl-toggleable:** introducing a base trigger class in purpose to simplify and make Trigger-Toggleable constructions more API strict in ESL ([4ea1565](4ea1565))
* **esl-utils:** add provider to default value in attr ([f13cc98](f13cc98))
* **esl-utils:** extend `attr` decorator with inherit option to take over the value of declared attribute ([a794886](a794886))
@ala-n
Copy link
Collaborator Author

ala-n commented Apr 10, 2024

🎉 This issue has been resolved in version 4.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ala-n ala-n added the released label Apr 10, 2024
ala-n pushed a commit that referenced this issue Apr 12, 2024
## [5.0.0-beta.12](v5.0.0-beta.11...v5.0.0-beta.12) (2024-04-12)

### ⚠ BREAKING CHANGES

* **esl-utils:** `Rect` utility object now immutable from TS perspective

### Features

* **esl-carousel:** `ESLCarouselTouchMixin` plugin is ready for usage with both: drag and touch support ([480bac1](480bac1))
* **esl-carousel:** add `esl-carousel` mouse wheel control support mixin ([748390c](748390c))
* **esl-carousel:** complete support of the drag (touch) for ESLCarousel ([94bc18f](94bc18f))
* **esl-carousel:** complete support of the navigation plugins for ESLCarousel ([19bd241](19bd241))
* **esl-carousel:** new `esl-carousel` component introduced according to spec [#1282](#1282) ([5b6fc64](5b6fc64))
* **esl-carousel:** support for autoplay mixin plugin for ESLCarousel component ([1deea71](1deea71))
* **esl-carousel:** support for relation mixin plugin for ESLCarousel component ([77cbbd9](77cbbd9))
* **esl-event-listener:** add `isVertical` property to `ESLSwipeGestureEvent` ([019715c](019715c))
* **esl-event-listener:** ootb ability to skip custom `longwheel` and `swipe` events in case of content scrolling ([#2098](#2098)) ([80c5747](80c5747)), closes [#2085](#2085)
* **esl-toggleable:** introducing alternative internal hooks `shouldShow`/`shouldHide` instead of deprecated `onBeforeShow`/`onBeforeHide`. ([3786423](3786423))
* **esl-utils:** add ability to resize Rect instance ([1a4aa60](1a4aa60))
* **esl-utils:** add provider to default value in attr ([f13cc98](f13cc98))
* **esl-utils:** extend `attr` decorator with inherit option to take over the value of declared attribute ([a794886](a794886))
* **esl-utils:** introduce `promisifyTransition` utility ([9dbabfc](9dbabfc))
* **esl-utils:** made Rect class immutable ([923c70a](923c70a))
* **esl-utils:** utility to postpone execution to microtask ([2a4c8c5](2a4c8c5))

### Bug Fixes

* **esl-event-listener:** fix support for any object-like host ([ae4c98d](ae4c98d))
* **esl-popup:** fix esl-popup infinitely created independently of placeholder state ([63ae414](63ae414))
* **esl-share:** fix merging of `additional`(nested) params when `ESLShareConfig.update` method is called ([b9b4e5f](b9b4e5f))
* **esl-share:** rename copy action `alertText` param to `copyAlertMsg` ([d3e3c3a](d3e3c3a))
* **esl-tab:** fix `esl-tabs` initialization delay before DOM ready ([52b0beb](52b0beb))
* **esl-utils:** fix argument list on next fn call ([c2e5c1d](c2e5c1d))
* **esl-utils:** fix event cancellation handling ([dffbc53](dffbc53))
@ala-n
Copy link
Collaborator Author

ala-n commented Apr 12, 2024

🎉 This issue has been resolved in version 5.0.0-beta.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants