You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the issue, and apologies for the delay. I can replicate this, but I need to dig into why exactly it's happening. It's possible this is related to the simulated slots feature that we use for components like ion-input and ion-textarea, since the bug doesn't replicate with non-simulated slots like the ones on ion-button.
This is not a bug if you understand how ionic components work internally. You slotted the button with slot="end" and the dom was manipulated internally so that button can get placed at the end, hence react can't find that component.
Try removing the slot="end" to see what i'm talking about.
To solve this, consider moving the IonButton one level up the DOM tree, so it can be a direct child of the IonItem component.
Verified on 9.0.9: typing into the input removes the Autofill button and clearing it brings the button back, with no crash. This was fixed by #30958 in v8.7.18, so upgrading to 8.7.18 or later fixes it with no changes to your component.
The cause was the simulated slots in ion-input and ion-textarea. Ionic moves anything with slot="start" or slot="end" into an internal wrapper, so when React removed the button with removeChild on the ion-input, the browser threw because the button was no longer a direct child. Ionic's build has a patch that handles this, but before 8.7.18 it never reached the build that @ionic/react uses. #30958 is titled for ion-radio-group, but its fix was a build setting that turned that patch on for every component in that build, ion-input included.
If you can't upgrade yet, keep the button rendered and hide it with an inline style instead of removing it, which works on 8.7.17:
The earlier comment suggesting this isn't a bug and moving the IonButton to be a direct child of IonItem avoids the crash, but the button then sits outside the input instead of in its end slot, so it doesn't render the same.
Closing this as completed since it's fixed in 8.7.18.
Activity
dev-charles15531 commentedon May 3, 2025
This is not a bug if you understand how ionic components work internally. You slotted the button with
slot="end"and the dom was manipulated internally so that button can get placed at the end, hence react can't find that component.Try removing the
slot="end"to see what i'm talking about.To solve this, consider moving the IonButton one level up the DOM tree, so it can be a direct child of the IonItem component.
chore(git): improve Ionitron to stop closing issues that have the 'ne…
thetaPC commentedon Oct 26, 2026
Thanks for the report, and sorry for the delay.
Verified on 9.0.9: typing into the input removes the
Autofillbutton and clearing it brings the button back, with no crash. This was fixed by #30958 in v8.7.18, so upgrading to 8.7.18 or later fixes it with no changes to your component.The cause was the simulated slots in
ion-inputandion-textarea. Ionic moves anything withslot="start"orslot="end"into an internal wrapper, so when React removed the button withremoveChildon theion-input, the browser threw because the button was no longer a direct child. Ionic's build has a patch that handles this, but before 8.7.18 it never reached the build that@ionic/reactuses. #30958 is titled forion-radio-group, but its fix was a build setting that turned that patch on for every component in that build,ion-inputincluded.If you can't upgrade yet, keep the button rendered and hide it with an inline style instead of removing it, which works on 8.7.17:
The earlier comment suggesting this isn't a bug and moving the
IonButtonto be a direct child ofIonItemavoids the crash, but the button then sits outside the input instead of in its end slot, so it doesn't render the same.Closing this as completed since it's fixed in 8.7.18.