Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

ionic/react - Popover not showing when

$
0
0

@waptik wrote:

I’m having issues showing popover when it is positioned on the same as item with an onClick event.
Here’s my code:


          <IonPopover
            isOpen={showPopover}
            onDidDismiss={e => {
              e.preventDefault();
              console.log('Popover for chapter actions selected.')
              setShowPopover(false);
            }}>
            <IonLabel>Delete</IonLabel>
          </IonPopover>

          <IonItem
            lines="none"
            button key={id}
            onClick={e => {
              e.preventDefault();
              props.history.push(`/some-link`, { heading .title, url: });
            }}>
         
            <IonLabel slot="start">
              <h2>{title}</h2>
              <h3>{uploaded_by}</h3>
              <h4>{releaseDate}</h4>
            </IonLabel>
         
            <IonButtons slot="end">
              <IonButton
                onClick={e => {
                  e.preventDefault();
                  setShowPopover(true);
                }}
              >
                <IonIcon icon={more} />
              </IonButton>
            </IonButtons>
          </IonItem>

Per the code above, when the icon to show the popover is clicked, i’m being redirected to the next page instead.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>