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

bug: useIonLoading, message container is always rendered even when not using a message #26219

Closed
4 of 7 tasks
bipoza opened this issue Nov 3, 2022 · 5 comments · Fixed by #26222
Closed
4 of 7 tasks
Labels
package: react @ionic/react package type: bug a confirmed bug report

Comments

@bipoza
Copy link
Contributor

bipoza commented Nov 3, 2022

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Using the useIonLoading() hook with the minimum parameters, we have a design error.

useIonLoading bug
bug

This element should not render if the message parameter is empty.

bug-example

Expected Behavior

This should be the default behavior.
default_behaviour

Steps to Reproduce

Using the <IonLoading isOpen={true} /> component works perfectly. The bug is not in the core. The bug occurs when receiving the default parameters in useIonLoading.

const [present, dismiss] = useIonLoading();
useEffect(()=>{
    present();
}, [])

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.20.3
Ionic Framework : @ionic/react 6.3.4

Capacitor:

Capacitor CLI : not installed
@capacitor/android : not installed
@capacitor/core : not installed
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.4
native-run : not installed globally

System:

NodeJS : v14.16.0
npm : 6.14.11
OS : macOS Monterey

Additional Information

This happens with @ionic/react in version 6.3.4 using the useIonLoading() hook.

@ionitron-bot ionitron-bot bot added the triage label Nov 3, 2022
@liamdebeasi liamdebeasi changed the title bug: useIonLoading - Default values are not initialized correctly using the hook bug: loading, message container is always rendered even when not using a message Nov 3, 2022
@liamdebeasi liamdebeasi self-assigned this Nov 3, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Nov 3, 2022
@ionitron-bot ionitron-bot bot removed triage labels Nov 3, 2022
@liamdebeasi liamdebeasi added package: react @ionic/react package and removed package: core @ionic/core package labels Nov 3, 2022
@liamdebeasi liamdebeasi changed the title bug: loading, message container is always rendered even when not using a message bug: useIonLoading, message container is always rendered even when not using a message Nov 3, 2022
@bipoza
Copy link
Contributor Author

bipoza commented Nov 3, 2022

@liamdebeasi I am preparing a pull request fixing this problem.

@liamdebeasi
Copy link
Member

Thank you!

@bipoza
Copy link
Contributor Author

bipoza commented Nov 3, 2022

Thanks @liamdebeasi

The pull request is ready!

@sean-perkins
Copy link
Contributor

Appreciate the PR for this!

This has been merged and will be available in both the nightly build and the next patch release of Ionic (6.3.5).

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 3, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package type: bug a confirmed bug report
Projects
None yet
3 participants