Remove cancel in action-sheet

How can I remove the “Cancel” option from the action-sheet?

Just don’t specify an item in the buttons option with role: 'cancel'

1 Like

I’m using <IonSelect>

<IonSelect
        interface="action-sheet"
        interfaceOptions={{
          header: "Units",
          buttons: [
            {
              text: "Delete",
              role: "destructive",
              handler: () => {
                console.log("Delete clicked");
              },
            },
            {
              text: "Share",
              handler: () => {
                console.log("Share clicked");
              },
            },
            {
              text: "Play (open modal)",
              handler: () => {
                console.log("Play clicked");
              },
            },
            {
              text: "Favorite",
              handler: () => {
                console.log("Favorite clicked");
              },
            },
          ],
        }}
        value={windSpeedPreference}
        onIonChange={e => dispatch(changeWindSpeedPreference(e.detail.value))}
      ></IonSelect>

This isn’t working. Thanks in advance.

Unfortunately, it’s not possible with IonSelect, as the cancel button is hard coded.

If you really need to not have this button here, then instead of using IonSelect just use the action sheet directly as in my example.