[Bug?] ModalBottomSheet loses contexts
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react-native, typescript
- Domain
- mobile
Research direction
Start by tracing the ModalBottomSheet path used when nativeOverlay is false, focusing on the custom in-library Portal implementation that reparents the sheet. Reproduce the context-loss example, then determine whether context preservation or documenting the limitation is the intended outcome; compare the behavior with react-native-teleport if that alternative is evaluated.
Written by the indexing model from the issue text.
Description
ModalBottomSheet (when not nativeOverlay) seems to use a custom in-library Portal implementation that reparents the sheet into a different tree, this makes child components/tree unable to use existing context from the tree.
// psuedocode
const Cx = createContext();
const SheetUser = () => {
return (
<Cx value={1}>
<ModalBottomSheet ...>
<Inner />
</ModalBottomSheet>
</Cx>
)
}
const Inner = () => {
const value = useContext(Cx)
// value is always undefined
return ...
}
This should either be documented on the documentation or it could be solved by using a library such as react-native-teleport
PS. I came across this issue while trying to add keyboard avoidance to a nativeOverlay modal sheet, and it does not seem to be really possible - keyboard state is undetectable inside the sheet. Should I make another issue for that?
- Dominant language
- Kotlin
- Stars
- 536
- Forks
- 24
- Avg merge
- 12h 10m
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from software-mansion/react-native-bottom-sheet
-
Android: NoSuchElementException in ScrollIndicators.refit when a scroll view is garbage collectedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
software-mansion/react-native-bottom-sheet#140 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
software-mansion/react-native-bottom-sheet#137 ·
Maintainers usually reply within 1 day
-
Feature request: opt-in native keyboard avoidancePossibly taken @Asad-Butt claimed this 5 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 22/100
software-mansion/react-native-bottom-sheet#134 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
software-mansion/react-native-bottom-sheet#132 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
software-mansion/react-native-bottom-sheet#74 · 1 comment ·
Maintainers usually reply within 1 day
All issues in software-mansion/react-native-bottom-sheet
Similar issues
-
Remove Collect againOpen
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
thisisartman/Meguri#211 ·
Maintainers usually reply within 1 day
-
follow-up
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
area:android fleet
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
emm3000/myGame#2175 · 1 comment ·
Maintainers usually reply within 1 day