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

fix: rely on Form.Control and controlId in Form.Group #2931

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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