Skip to content

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Nov 17, 2023

Description

After giving it some thought, we decided to add new modifier to our handlers - mouseButton. This way users will be able to choose mouse buttons that handler will respond to.

For now this prop is available on all handlers, but it is a topic for a short discussion.

I think it is also worth to mention, that right now all three mouse buttons work on web, so this prop will allow us to 'disable' all buttons except those provided as arguments.

This PR also adds two small examples (one for buttons and one for context menu) that can be used to test given prop on other platforms (when this functionality will be added)

Test plan

Tested on example app.

@m-bert m-bert marked this pull request as ready for review November 20, 2023 09:03
@m-bert m-bert requested a review from j-piasecki December 20, 2023 15:26
@m-bert m-bert requested a review from j-piasecki January 15, 2024 13:24
@m-bert m-bert requested a review from j-piasecki January 16, 2024 10:15
@m-bert m-bert merged commit a30f42f into main Jan 16, 2024
@m-bert m-bert deleted the @mbert/web-right-click branch January 16, 2024 13:28
renovate bot referenced this pull request in valora-xyz/wallet Feb 17, 2024
…4933)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-gesture-handler](https://togithub.com/software-mansion/react-native-gesture-handler)
| [`^2.14.1` ->
`^2.15.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.14.1/2.15.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-gesture-handler
(react-native-gesture-handler)</summary>

###
[`v2.15.0`](https://togithub.com/software-mansion/react-native-gesture-handler/releases/tag/2.15.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-gesture-handler/compare/2.14.1...2.15.0)

#### ❗ Important changes

- macOS Support by [@&#8203;HeroBanana](https://togithub.com/HeroBanana)
and [@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2588)
- feat: add visionOS support by
[@&#8203;tomekzaw](https://togithub.com/tomekzaw) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2743](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2743)
- Add `mouseButton` prop by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2676](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2676)
- Migrate Gesture Handler to TurboModule by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2354](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2354)

#### 🐛 Bug fixes

- Add checks for the same instance of handler usage across multiple
`GestureDetectors` by [@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2694](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2694)
- Remove `didMountComponentsWithRootTag` on the new arch by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2687](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2687)
- Fix double start when `activateAfterLongPress` is used by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2628](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2628)
- Reset relevant handler when recognizer gets reset. by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2705](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2705)
- Fix `inactive` handlers staying at finished state by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2738](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2738)
- Change functions in windows module file to no-ops. by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2741](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2741)
- Fix handlers coming back from being cancelled by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2704](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2704)
- fix: restore ReactMethod annotation by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2722](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2722)

#### 🔢 Miscellaneous

- Bump react-devtools-core from 4.27.6 to 4.28.4 in /example by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2650](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2650)
- Add `workflow_dispatch` to workflows by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2295](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2295)
- Update supported versions in readme and in docs by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2684](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2684)
- Prevent GH actions trigger on forks, update template by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2696](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2696)
- Auto add `Platform: MacOS` label when `MacOS` is picked in the issue
by [@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2699](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2699)
- Change eslint `ban-types` to warning. by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2714](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2714)
- Fix macOS warning message by
[@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2713)
- Bump dependencies to stable React Native 0.73.2 by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2698](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2698)
- Add macOS app icon by [@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2723](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2723)
- Bump follow-redirects from 1.15.3 to 1.15.4 in /e2e/web-tests by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2719](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2719)

#### New Contributors

- [@&#8203;mrousavy](https://togithub.com/mrousavy) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2690](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2690)
- [@&#8203;HeroBanana](https://togithub.com/HeroBanana) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2588)
- [@&#8203;fxamauri](https://togithub.com/fxamauri) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2712](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2712)
- [@&#8203;jfedak](https://togithub.com/jfedak) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2713)
- [@&#8203;computerjazz](https://togithub.com/computerjazz) made their
first contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2715](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2715)

**Full Changelog**:
software-mansion/react-native-gesture-handler@2.14.0...2.15.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <[email protected]>
m-bert added a commit that referenced this pull request Feb 20, 2024
## Description

This PR adds implementation of `mouseButton` prop on android.

Since `actionButton` field is available only in API >= 23, we provide full support only for those versions. The only thing that changes for API < 23 is ignoring `ACTION_BUTTON_*`, because we don't want handlers to react to both type of events.

Note that it requires [this PR](#2676) to work.

## Test plan

Tested on `MouseButtons` example.
shottah referenced this pull request in Kolektivo/Kolektivo-Mobile-App May 15, 2024
…alora-xyz#4933)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-gesture-handler](https://togithub.com/software-mansion/react-native-gesture-handler)
| [`^2.14.1` ->
`^2.15.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.14.1/2.15.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-gesture-handler
(react-native-gesture-handler)</summary>

###
[`v2.15.0`](https://togithub.com/software-mansion/react-native-gesture-handler/releases/tag/2.15.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-gesture-handler/compare/2.14.1...2.15.0)

#### ❗ Important changes

- macOS Support by [@&#8203;HeroBanana](https://togithub.com/HeroBanana)
and [@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2588)
- feat: add visionOS support by
[@&#8203;tomekzaw](https://togithub.com/tomekzaw) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2743](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2743)
- Add `mouseButton` prop by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2676](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2676)
- Migrate Gesture Handler to TurboModule by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2354](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2354)

#### 🐛 Bug fixes

- Add checks for the same instance of handler usage across multiple
`GestureDetectors` by [@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2694](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2694)
- Remove `didMountComponentsWithRootTag` on the new arch by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2687](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2687)
- Fix double start when `activateAfterLongPress` is used by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2628](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2628)
- Reset relevant handler when recognizer gets reset. by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2705](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2705)
- Fix `inactive` handlers staying at finished state by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2738](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2738)
- Change functions in windows module file to no-ops. by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2741](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2741)
- Fix handlers coming back from being cancelled by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2704](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2704)
- fix: restore ReactMethod annotation by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2722](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2722)

#### 🔢 Miscellaneous

- Bump react-devtools-core from 4.27.6 to 4.28.4 in /example by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2650](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2650)
- Add `workflow_dispatch` to workflows by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2295](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2295)
- Update supported versions in readme and in docs by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2684](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2684)
- Prevent GH actions trigger on forks, update template by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2696](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2696)
- Auto add `Platform: MacOS` label when `MacOS` is picked in the issue
by [@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2699](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2699)
- Change eslint `ban-types` to warning. by
[@&#8203;m-bert](https://togithub.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2714](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2714)
- Fix macOS warning message by
[@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2713)
- Bump dependencies to stable React Native 0.73.2 by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2698](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2698)
- Add macOS app icon by [@&#8203;jfedak](https://togithub.com/jfedak) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2723](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2723)
- Bump follow-redirects from 1.15.3 to 1.15.4 in /e2e/web-tests by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2719](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2719)

#### New Contributors

- [@&#8203;mrousavy](https://togithub.com/mrousavy) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2690](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2690)
- [@&#8203;HeroBanana](https://togithub.com/HeroBanana) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2588)
- [@&#8203;fxamauri](https://togithub.com/fxamauri) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2712](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2712)
- [@&#8203;jfedak](https://togithub.com/jfedak) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2713)
- [@&#8203;computerjazz](https://togithub.com/computerjazz) made their
first contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2715](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2715)

**Full Changelog**:
software-mansion/react-native-gesture-handler@2.14.0...2.15.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants