Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-search-field] Remove redundant search group #4019

Merged
merged 15 commits into from
Feb 8, 2024
Merged
Prev Previous commit
Next Next commit
Updated wdio snapshots
  • Loading branch information
KV106606Viswanath committed Feb 7, 2024
commit 868d3796d1a9072f79e694f57a095f8ccc81e35e
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import SearchField from 'terra-search-field';

export default () => <SearchField id="searchfield" isLabelVisible />;
export default () => <SearchField id="searchfield" isLabelVisible groupName="Find a clinic" />;
6 changes: 3 additions & 3 deletions packages/terra-search-field/src/SearchField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class SearchField extends React.Component {
customProps.className,
);

const inputAriaLabelText = inputAttributes && Object.prototype.hasOwnProperty.call(inputAttributes, 'aria-label') ? inputAttributes['aria-label'] : groupName;
const ariaLabel = groupName !== 'Search' ? inputAriaLabelText : null;
const groupNameValue = groupName !== 'Search' ? groupName : '';
const inputAriaLabelText = inputAttributes && Object.prototype.hasOwnProperty.call(inputAttributes, 'aria-label') ? inputAttributes['aria-label'] : groupNameValue;
const buttonText = intl.formatMessage({ id: 'Terra.searchField.submit-search' });
const clearText = intl.formatMessage({ id: 'Terra.searchField.clear' });
const additionalInputAttributes = { ...inputAttributes };
Expand Down Expand Up @@ -316,7 +316,7 @@ class SearchField extends React.Component {
placeholder={placeholder}
onChange={this.handleTextChange}
disabled={isDisabled}
aria-label={ariaLabel}
aria-label={inputAriaLabelText}
aria-disabled={isDisabled}
onKeyDown={this.handleKeyDown}
onInput={this.handleInput}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading