Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
Button in React Form needs take size of parent

I have the following React JS code for a form. I have heavily simplified the code to get to the root of the problem.

Links to imports: Icon and Form

import Icon from "semantic-ui-react";
import Form from "react-bootstrap/Form";
import {FormControl, InputGroup} from "react-bootstrap";

<Form onSubmit={e=> {handleInput(e)}}>
  <FormControl
     //stuff here
  />
  <InputGroup.Append>
     <InputGroup.Text className="field">
         // the bottom class removes all button styling
         // so that InputGroup.Text styling is used
         <button type="submit" className="no-btn-style">
            <Icon name="add">
         </button>
     </InputGroup.Text>
   </InputGroup.Append>
 </Form>

The CSS styling for .no-btn-style:

.no-btn-style, input[type="submit"], .no-btn-style:hover, .no-btn-style:focus {
  background: none !important;
  color: none !important;
  border: none !important;
  padding: 0 !important;
  font: none !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
}

The InputGroup.Append is the entire grey box on the right: enter image description here

enter image description here

Here is the size of the button inside InputGroup.Append: enter image description here

I need to be able to have the entire grey region (shown in red) be the button. I was thinking that the button could inherit the size of the InputGroup.Text. But when I add this to the class I defined above, it isn't working:

height: inherit !important;
width: inherit !important;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can try with

height: 100% !important;
width: 100% !important;

It will take size of a parent.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda