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

IonSelect with IonGrid: Displayed Option too short

$
0
0

@ccssmnn wrote:

I’m using IonSelect inside an IonGrid. The displayed options text is shorter that it has to be. It is especially short when a Label is provided.

Here are the images:

ionselect-with-label ionselect-no-label

The code:

import * as React from "react";
import { render } from "react-dom";
// core css for ionic to work properly
import "@ionic/react/css/core.css";
import {
  IonSelect,
  IonItem,
  IonSelectOption,
  IonGrid,
  IonRow,
  IonCol,
  IonLabel
} from "@ionic/react";

function App() {
  const [value, setValue] = React.useState("");
  const options = ["short", "loooooooooong", "veeeeeeeeeery loooooooooong"];
  return (
    <IonGrid>
      <IonRow>
        <IonCol size="6">
          <IonItem>
            <IonLabel>Label</IonLabel>
            <IonSelect
              interface="popover"
              placeholder="Select one"
              value={value}
              onIonChange={e => setValue(e.detail.value)}
            >
              {options.map((option, i) => (
                <IonSelectOption value={option} key={i}>
                  {option}
                </IonSelectOption>
              ))}
            </IonSelect>
          </IonItem>
        </IonCol>
      </IonRow>
    </IonGrid>
  );
}

const rootElement = document.getElementById("root");
render(<App />, rootElement);

Any suggestions?

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



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