Close menu before navigation


I am using Ionic v6 with the split-pane mode and when the side menu is enabled (device too small for split-pane mode) I have a bug where the menu won’t close before navigating to a new page, or worse, if I click on the link of the page I’m already on, nothing happen.

Here is the code:

<IonSplitPane when="md" contentId="main-content">
     <IonMenu content-id="main-content" type={"reveal"}>
                <IonToolbar color={"warning"}>
                    <IonRouterLink color={"light"} slot={"start"}

                <IonList lines={"full"}>
                    <IonItem button routerLink={"/"} detail={false}>
                        <IonIcon src={home} slot={"start"}/>
                            <Trans i18nKey={"pages.home.title"}>Home</Trans>
                    <IonItemDivider><Trans i18nKey={""}>Info</Trans></IonItemDivider>
                    <IonItem button routerLink={"/infos"} detail={false}>
                        <IonIcon src={informationCircle} slot={"start"}/>
                            <Trans i18nKey={"pages.infos.title"}>Information</Trans>
    <div className="ion-page" id="main-content">

Am I doing something wrong ?


Found the solution, needed to put IonMenuToggle inside List to close menu upon navigation

We can see how to make a good Router code in the Ionic example: