Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!