Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda