Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with " select " #1439

Open
Everton617 opened this issue Jun 14, 2024 · 0 comments
Open

Trouble with " select " #1439

Everton617 opened this issue Jun 14, 2024 · 0 comments

Comments

@Everton617
Copy link

I'm having trouble inside my Modal. I put 3 inputs and 1 select to enter the data, all the inputs are managing to pass the inserted data to their respective functions called 'onChange', except the select. In the output of the data, the selected 'container.title' is not being displayed; the onChange function of the select is not receiving any value.

`

    <div className="flex flex-col w-full items-start gap-y-4">
      <h1 className="text-gray-800 text-3xl font-bold">{t('Adicionar Pedido')}</h1>
      <Input
        type="text"
        placeholder="Pedido"
        name="pedido"
        value={Pedido}
        onChange={(e) => setPedido(e.target.value)}
      />

      <select 
      className="select select-bordered w-full max-w-xs" 
      onChange={(e) => setStatus(e.target.value)}>
        {containers
          .filter(container => container.id === currentContainerId) // Filtrar apenas o contêiner atual
          .map(container => (
            <option key={container.id} value={container.title}>{container.title}</option>
          ))
        }
      </select>
      <Input
        type="text"
        placeholder="Horário"
        name="horario"
        value={Horario}
        onChange={(e) => setHorario(e.target.value)}
      />
      <Input
        type="text"
        placeholder="Entregador"
        name="entregador"
        value={Entregador}
        onChange={(e) => setEntregador(e.target.value)}
      />
      <Button  variant='destructive'  onClick={onAddItem}>{t('Adicionar Pedido')}</Button>
    </div>
  </Modal>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant