Comments (4)
Thanks for the issue! This issue has been labeled as needs reproduction
. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
from ionic-framework.
Here the github repo https://github.com/mattiaGec/IonicModalTest
from ionic-framework.
modal.bug.mp4
from ionic-framework.
Hello @mattiaGec thank you for reporting this issue!
I can confirm the problematic behavior.
When the dismiss
callback returned by useIonModal
is called multiple times, it only attempts to dismiss the modal the first time it is called.
This is due to the implementation for the dismiss
method in useOverlay
:
ionic-framework/packages/react/src/hooks/useOverlay.ts
Lines 86 to 90 in 35ab6b4
The specific problem is this line of code:
We should only be clearing the overlay reference if the overlay actually dismissed, by looking at the return value ofoverlayRef.current.dismiss
. If the overlay did not dismiss, we should not clear the reference.
I will classify this as a bug and the team can prioritize it within the backlog. If anyone would like to submit a PR for this, I would gladly welcome the contribution!
This would be the proposed change that I would validate with testing:
const dismiss = useCallback(async (data?: any, role?: string) => {
if (overlayRef.current) {
const didDismiss = await overlayRef.current.dismiss(data, role);
if (didDismiss) {
overlayRef.current = undefined;
containerElRef.current = undefined;
}
}
}, []);
from ionic-framework.
Related Issues (20)
- bug: UI Diference between slot start and end, with ion-icon within ion-item HOT 5
- bug: Too much recursion error when using @mui MobileDatePicker inside a IonModal component HOT 1
- feat: Badges in ion-tabs HOT 9
- bug: ion-popover arrow navigation breaks on disabled element HOT 1
- bug: CloseWatcher API Prevents Navigation When No Overlays Are Present in Chromium v126
- feat: gguf bundling HOT 1
- ion-back-button over ion-toast HOT 11
- bug: iOS 17.5, animation flicker
- bug: Vue ionic plugin has no type HOT 3
- bug: Opening ion-modal from button inside ion-datetime has no trigger element in the DOM - modal can be opened only once HOT 2
- Ionic7 on Windows with NPM10 NODEJS21 bug: Ionic Serve Works Ionic Build doesnt create tabs HOT 1
- bug: ion-range throws: Cannot read properties of undefined.
- bug: An empty ion-datetime value gives a default date of May 2021
- bug: ionChange not fired on iOS 16 devices for ion-picker HOT 1
- bug: ion-datetime, error when selecting the year and month when [multiple] is true
- bug: Standalone IonIcon type does not expose any component properties
- bug: Ion-datetime wrong translation HOT 1
- bug: DOMException: Failed to execute 'insertBefore' on 'Node' HOT 2
- bug: ion-datetime with locale="fa-ir" problem. HOT 2
- Hey there, HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-framework.