Skip to content

Commit

Permalink
fix: rely on Form.Control and controlId in Form.Group (#2931)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Jan 11, 2024
1 parent 35bfa7d commit b858230
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/DataTable/filters/TextFilter.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useRef } from 'react';
import PropTypes from 'prop-types';
import Form, { FormLabel } from '../../Form';
import Input from '../../Input';
import Form from '../../Form';
import { newId } from '../../utils';

const formatHeaderForLabel = (header) => {
Expand All @@ -23,10 +22,9 @@ function TextFilter({
const formattedHeader = formatHeaderForLabel(Header);
const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;
return (
<Form.Group>
<FormLabel id={ariaLabel.current} className="sr-only">{inputText}</FormLabel>
<Input
aria-labelledby={ariaLabel.current}
<Form.Group controlId={ariaLabel.current}>
<Form.Label className="sr-only">{inputText}</Form.Label>
<Form.Control
value={filterValue || ''}
type="text"
onChange={e => {
Expand Down

0 comments on commit b858230

Please sign in to comment.