callstack / callstack/react-native-paper

Menu onDismiss Animation

Open
#4,813 0 comments 2 reactions 0 assignees View on GitHub
feature request
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
12

Description

**Is your feature request related to a problem? Please describe.**
Some of the menu component's onDismiss handling ([1](https://github.com/callstack/react-native-paper/blob/ff0df5454eb13d6e8e2d8f1c87c0bca8bb3635f0/src/components/Menu/Menu.tsx#L643),[2](https://github.com/callstack/react-native-paper/blob/ff0df5454eb13d6e8e2d8f1c87c0bca8bb3635f0/src/components/Menu/Menu.tsx#L654)) does NOT call hide(); if I change the menu's visibility within ondismiss it cancels the animation entirely

**Describe the solution you'd like**
[make hide accepts a callback](https://github.com/lovegaoshi/azusa-player-mobile/blob/2648f55f4cb6c6dd72433a871a63249cbed79d1e/patches/react-native-paper%2B5.14.5.patch#L18), calls the callback at the end of the animation, and replace the onDismiss to `() => hide(onDismiss)`

**Describe alternatives you've considered**
I might have totally missed the memo on how to control the menu visibility via onDismiss.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start at src/components/Menu/Menu.tsx, especially the onDismiss handling linked around lines 643 and 654, and inspect the existing hide animation flow. Done means the dismiss callback runs after the animation completes and changing visibility from onDismiss no longer cancels that animation.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.