Unverified Commit 3a8ecdbd authored by Allison Suarez Miranda's avatar Allison Suarez Miranda Committed by GitHub

fix: replaced aria-label with sr-only to improve accessiblity (#509)

* updated all aria-label componets to use sr-only instead, still need to update tests and fix the constants imports

* fixed imports for constants on RequestMetadataForm comp

* another constants import fix

* removed aria-label attribute from tests

* yet another constants fix

* removed the aria-label as well as the sr-only for the add button on the add owner pop up, this is because when selecting the edit button the sr would read edit on Owners, which means that if this option is selected it can be assumed that when the sr reads Add, it will be related to adding an Owner. Trying to have both a sr-only plus the label of the button itself would lead to confusion because i would read add owner and then add, before with aria-hidden it would just hide Add and say add owner, making this not an issue. We could also keep aria-hidden but idk if this also has support gaps

* added newline at end of file

* added newline at end of file

* fixed format issues

* package oopsie
parent 240dcf39
...@@ -129,6 +129,7 @@ $aside-separation-space: 40px; ...@@ -129,6 +129,7 @@ $aside-separation-space: 40px;
.markdown-wrapper { .markdown-wrapper {
font-size: 16px; font-size: 16px;
> p { > p {
margin: 0; margin: 0;
} }
......
...@@ -142,7 +142,6 @@ describe('Feedback', () => { ...@@ -142,7 +142,6 @@ describe('Feedback', () => {
expect(button.props()).toMatchObject({ expect(button.props()).toMatchObject({
type: 'button', type: 'button',
className: 'btn btn-close', className: 'btn btn-close',
'aria-label': BUTTON_CLOSE_TEXT,
onClick: wrapper.instance().toggle, onClick: wrapper.instance().toggle,
}); });
}); });
...@@ -163,7 +162,6 @@ describe('Feedback', () => { ...@@ -163,7 +162,6 @@ describe('Feedback', () => {
expect(buttonGroup.props()).toMatchObject({ expect(buttonGroup.props()).toMatchObject({
className: 'btn-group', className: 'btn-group',
role: 'group', role: 'group',
'aria-label': FEEDBACK_TYPE_TEXT,
}); });
}); });
......
...@@ -5,15 +5,7 @@ import BugReportFeedbackForm from './FeedbackForm/BugReportFeedbackForm'; ...@@ -5,15 +5,7 @@ import BugReportFeedbackForm from './FeedbackForm/BugReportFeedbackForm';
import RatingFeedbackForm from './FeedbackForm/RatingFeedbackForm'; import RatingFeedbackForm from './FeedbackForm/RatingFeedbackForm';
import RequestFeedbackForm from './FeedbackForm/RequestFeedbackForm'; import RequestFeedbackForm from './FeedbackForm/RequestFeedbackForm';
import { import * as Constants from './constants';
BUG_REPORT_TEXT,
FEEDBACK_BUTTON_TEXT,
BUTTON_CLOSE_TEXT,
FEEDBACK_TITLE,
FEEDBACK_TYPE_TEXT,
RATING_TEXT,
REQUEST_TEXT,
} from './constants';
// TODO: Use css-modules instead of 'import' // TODO: Use css-modules instead of 'import'
import './styles.scss'; import './styles.scss';
...@@ -41,7 +33,7 @@ export default class Feedback extends React.Component< ...@@ -41,7 +33,7 @@ export default class Feedback extends React.Component<
> { > {
static defaultProps = { static defaultProps = {
content: <RatingFeedbackForm />, content: <RatingFeedbackForm />,
title: FEEDBACK_TITLE, title: Constants.FEEDBACK_TITLE,
}; };
constructor(props) { constructor(props) {
...@@ -82,7 +74,7 @@ export default class Feedback extends React.Component< ...@@ -82,7 +74,7 @@ export default class Feedback extends React.Component<
}`} }`}
onClick={this.toggle} onClick={this.toggle}
> >
<span className="sr-only">{FEEDBACK_BUTTON_TEXT}</span> <span className="sr-only">{Constants.FEEDBACK_BUTTON_TEXT}</span>
<img className="icon icon-help" alt="" /> <img className="icon icon-help" alt="" />
</button> </button>
{this.state.isOpen && ( {this.state.isOpen && (
...@@ -92,16 +84,14 @@ export default class Feedback extends React.Component< ...@@ -92,16 +84,14 @@ export default class Feedback extends React.Component<
<button <button
type="button" type="button"
className="btn btn-close" className="btn btn-close"
aria-label={BUTTON_CLOSE_TEXT}
onClick={this.toggle} onClick={this.toggle}
/> >
<span className="sr-only">{Constants.BUTTON_CLOSE_TEXT}</span>
</button>
</div> </div>
<div className="text-center"> <div className="text-center">
<div <div className="btn-group" role="group">
className="btn-group" <span className="sr-only">{Constants.FEEDBACK_TYPE_TEXT}</span>
role="group"
aria-label={FEEDBACK_TYPE_TEXT}
>
<button <button
type="button" type="button"
className={ className={
...@@ -112,7 +102,7 @@ export default class Feedback extends React.Component< ...@@ -112,7 +102,7 @@ export default class Feedback extends React.Component<
} }
onClick={this.changeType(FeedbackType.Rating)} onClick={this.changeType(FeedbackType.Rating)}
> >
{RATING_TEXT} {Constants.RATING_TEXT}
</button> </button>
<button <button
type="button" type="button"
...@@ -124,7 +114,7 @@ export default class Feedback extends React.Component< ...@@ -124,7 +114,7 @@ export default class Feedback extends React.Component<
} }
onClick={this.changeType(FeedbackType.Bug)} onClick={this.changeType(FeedbackType.Bug)}
> >
{BUG_REPORT_TEXT} {Constants.BUG_REPORT_TEXT}
</button> </button>
<button <button
type="button" type="button"
...@@ -136,7 +126,7 @@ export default class Feedback extends React.Component< ...@@ -136,7 +126,7 @@ export default class Feedback extends React.Component<
} }
onClick={this.changeType(FeedbackType.Request)} onClick={this.changeType(FeedbackType.Request)}
> >
{REQUEST_TEXT} {Constants.REQUEST_TEXT}
</button> </button>
</div> </div>
</div> </div>
......
export const DEFAULT_ERROR_TEXT = export const DEFAULT_ERROR_TEXT =
'There was a problem with the request, please reload the page.'; 'There was a problem with the request, please reload the page.';
export const USERID_LABEL = 'email address'; export const USERID_LABEL = 'email address';
export const ADD_ITEM = 'Add';
export const DELETE_ITEM = 'Delete Item';
...@@ -175,12 +175,8 @@ export class OwnerEditor extends React.Component< ...@@ -175,12 +175,8 @@ export class OwnerEditor extends React.Component<
ref={this.inputRef} ref={this.inputRef}
/> />
{/* eslint-enable jsx-a11y/no-autofocus */} {/* eslint-enable jsx-a11y/no-autofocus */}
<button <button className="btn btn-default add-button" type="submit">
className="btn btn-default add-button" {Constants.ADD_ITEM}
type="submit"
aria-label="Add Item"
>
<span aria-hidden="true">Add</span>
</button> </button>
</form> </form>
<ul className="component-list"> <ul className="component-list">
...@@ -193,11 +189,11 @@ export class OwnerEditor extends React.Component< ...@@ -193,11 +189,11 @@ export class OwnerEditor extends React.Component<
)} )}
<button <button
className="btn btn-flat-icon delete-button" className="btn btn-flat-icon delete-button"
aria-label="Delete Item"
/* tslint:disable - TODO: Investigate jsx-no-lambda rule */ /* tslint:disable - TODO: Investigate jsx-no-lambda rule */
onClick={() => this.recordDeleteItem(key)} onClick={() => this.recordDeleteItem(key)}
/* tslint:enable */ /* tslint:enable */
> >
<span className="sr-only">{Constants.DELETE_ITEM}</span>
<img className="icon icon-delete" alt="" /> <img className="icon icon-delete" alt="" />
</button> </button>
</li> </li>
......
export const REPORT_DATA_ISSUE_TEXT = 'Report an issue'; export const REPORT_DATA_ISSUE_TEXT = 'Report an issue';
export const TABLE_OWNERS_NOTE = export const TABLE_OWNERS_NOTE =
'Please note: Table owners will also be notified via email when an issue is reported.'; 'Please note: Table owners will also be notified via email when an issue is reported.';
export const CLOSE = 'Close';
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
NotificationPayload, NotificationPayload,
NotificationType, NotificationType,
} from 'interfaces'; } from 'interfaces';
import { REPORT_DATA_ISSUE_TEXT, TABLE_OWNERS_NOTE } from './constants'; import * as Constants from './constants';
export interface ComponentProps { export interface ComponentProps {
tableKey: string; tableKey: string;
...@@ -109,17 +109,20 @@ export class ReportTableIssue extends React.Component< ...@@ -109,17 +109,20 @@ export class ReportTableIssue extends React.Component<
className="report-table-issue-link" className="report-table-issue-link"
onClick={this.toggle} onClick={this.toggle}
> >
{REPORT_DATA_ISSUE_TEXT} {Constants.REPORT_DATA_ISSUE_TEXT}
</a> </a>
{this.state.isOpen && ( {this.state.isOpen && (
<div className="report-table-issue-modal"> <div className="report-table-issue-modal">
<h3 className="data-issue-header">{REPORT_DATA_ISSUE_TEXT}</h3> <h3 className="data-issue-header">
{Constants.REPORT_DATA_ISSUE_TEXT}
</h3>
<button <button
type="button" type="button"
className="btn btn-close" className="btn btn-close"
aria-label="close"
onClick={this.toggle} onClick={this.toggle}
/> >
<span className="sr-only">{Constants.CLOSE}</span>
</button>
<form id="report-table-issue-form" onSubmit={this.submitForm}> <form id="report-table-issue-form" onSubmit={this.submitForm}>
<div className="form-group"> <div className="form-group">
<label>Title</label> <label>Title</label>
...@@ -144,7 +147,9 @@ export class ReportTableIssue extends React.Component< ...@@ -144,7 +147,9 @@ export class ReportTableIssue extends React.Component<
Submit Submit
</button> </button>
</form> </form>
<div className="data-owner-notification">{TABLE_OWNERS_NOTE}</div> <div className="data-owner-notification">
{Constants.TABLE_OWNERS_NOTE}
</div>
</div> </div>
)} )}
</> </>
......
...@@ -22,3 +22,5 @@ export const COMMENT_PLACEHOLDER_COLUMN = ...@@ -22,3 +22,5 @@ export const COMMENT_PLACEHOLDER_COLUMN =
export const COLUMN_REQUESTED_COMMENT_PREFIX = export const COLUMN_REQUESTED_COMMENT_PREFIX =
'Description requested for column: '; 'Description requested for column: ';
export const CLOSE = 'Close';
...@@ -25,23 +25,7 @@ import { ...@@ -25,23 +25,7 @@ import {
closeRequestDescriptionDialog, closeRequestDescriptionDialog,
submitNotification, submitNotification,
} from 'ducks/notification/reducer'; } from 'ducks/notification/reducer';
import { import * as Constants from './constants';
TITLE_TEXT,
FROM_LABEL,
TO_LABEL,
REQUEST_TYPE,
TABLE_DESCRIPTION,
COLUMN_DESCRIPTIONS,
COLUMN_REQUESTED_COMMENT_PREFIX,
COMMENT_PLACEHOLDER_COLUMN,
COMMENT_PLACEHOLDER_DEFAULT,
ADDITIONAL_DETAILS,
RECIPIENT_LIST_DELIMETER,
SEND_BUTTON,
SEND_FAILURE_MESSAGE,
SEND_INPROGRESS_MESSAGE,
SEND_SUCCESS_MESSAGE,
} from './constants';
interface StateFromProps { interface StateFromProps {
columnName?: string; columnName?: string;
...@@ -84,11 +68,11 @@ export class RequestMetadataForm extends React.Component< ...@@ -84,11 +68,11 @@ export class RequestMetadataForm extends React.Component<
getFlashMessageString = (): string => { getFlashMessageString = (): string => {
switch (this.props.sendState) { switch (this.props.sendState) {
case SendingState.COMPLETE: case SendingState.COMPLETE:
return SEND_SUCCESS_MESSAGE; return Constants.SEND_SUCCESS_MESSAGE;
case SendingState.ERROR: case SendingState.ERROR:
return SEND_FAILURE_MESSAGE; return Constants.SEND_FAILURE_MESSAGE;
case SendingState.WAITING: case SendingState.WAITING:
return SEND_INPROGRESS_MESSAGE; return Constants.SEND_INPROGRESS_MESSAGE;
default: default:
return ''; return '';
} }
...@@ -109,7 +93,9 @@ export class RequestMetadataForm extends React.Component< ...@@ -109,7 +93,9 @@ export class RequestMetadataForm extends React.Component<
const form = document.getElementById('RequestForm') as HTMLFormElement; const form = document.getElementById('RequestForm') as HTMLFormElement;
const formData = new FormData(form); const formData = new FormData(form);
const recipientString = formData.get('recipients') as string; const recipientString = formData.get('recipients') as string;
const recipients = recipientString.split(RECIPIENT_LIST_DELIMETER.trim()); const recipients = recipientString.split(
Constants.RECIPIENT_LIST_DELIMETER.trim()
);
const sender = formData.get('sender') as string; const sender = formData.get('sender') as string;
const descriptionRequested = formData.get('table-description') === 'on'; const descriptionRequested = formData.get('table-description') === 'on';
const fieldsRequested = formData.get('column-description') === 'on'; const fieldsRequested = formData.get('column-description') === 'on';
...@@ -144,7 +130,7 @@ export class RequestMetadataForm extends React.Component< ...@@ -144,7 +130,7 @@ export class RequestMetadataForm extends React.Component<
const colDescriptionNeeded = const colDescriptionNeeded =
requestMetadataType === RequestMetadataType.COLUMN_DESCRIPTION; requestMetadataType === RequestMetadataType.COLUMN_DESCRIPTION;
const defaultComment = columnName const defaultComment = columnName
? `${COLUMN_REQUESTED_COMMENT_PREFIX}${columnName}` ? `${Constants.COLUMN_REQUESTED_COMMENT_PREFIX}${columnName}`
: ''; : '';
if (sendState !== SendingState.IDLE) { if (sendState !== SendingState.IDLE) {
...@@ -158,17 +144,18 @@ export class RequestMetadataForm extends React.Component< ...@@ -158,17 +144,18 @@ export class RequestMetadataForm extends React.Component<
return ( return (
<div className="request-component expanded"> <div className="request-component expanded">
<div id="request-metadata-title" className="form-group request-header"> <div id="request-metadata-title" className="form-group request-header">
<h3 className="title">{TITLE_TEXT}</h3> <h3 className="title">{Constants.TITLE_TEXT}</h3>
<button <button
type="button" type="button"
className="btn btn-close" className="btn btn-close"
aria-label="Close"
onClick={this.closeDialog} onClick={this.closeDialog}
/> >
<span className="sr-only">{Constants.CLOSE}</span>
</button>
</div> </div>
<form onSubmit={this.submitNotification} id="RequestForm"> <form onSubmit={this.submitNotification} id="RequestForm">
<div id="sender-form-group" className="form-group"> <div id="sender-form-group" className="form-group">
<label>{FROM_LABEL}</label> <label>{Constants.FROM_LABEL}</label>
<input <input
type="email" type="email"
autoComplete="off" autoComplete="off"
...@@ -180,7 +167,7 @@ export class RequestMetadataForm extends React.Component< ...@@ -180,7 +167,7 @@ export class RequestMetadataForm extends React.Component<
/> />
</div> </div>
<div id="recipients-form-group" className="form-group"> <div id="recipients-form-group" className="form-group">
<label>{TO_LABEL}</label> <label>{Constants.TO_LABEL}</label>
<input <input
type="text" type="text"
autoComplete="off" autoComplete="off"
...@@ -188,18 +175,20 @@ export class RequestMetadataForm extends React.Component< ...@@ -188,18 +175,20 @@ export class RequestMetadataForm extends React.Component<
className="form-control" className="form-control"
required required
multiple multiple
defaultValue={tableOwners.join(RECIPIENT_LIST_DELIMETER)} defaultValue={tableOwners.join(
Constants.RECIPIENT_LIST_DELIMETER
)}
/> />
</div> </div>
<div id="request-type-form-group" className="form-group"> <div id="request-type-form-group" className="form-group">
<label>{REQUEST_TYPE}</label> <label>{Constants.REQUEST_TYPE}</label>
<label className="select-label"> <label className="select-label">
<input <input
type="checkbox" type="checkbox"
name="table-description" name="table-description"
defaultChecked={tableDescriptionNeeded} defaultChecked={tableDescriptionNeeded}
/> />
{TABLE_DESCRIPTION} {Constants.TABLE_DESCRIPTION}
</label> </label>
<label className="select-label"> <label className="select-label">
<input <input
...@@ -207,18 +196,18 @@ export class RequestMetadataForm extends React.Component< ...@@ -207,18 +196,18 @@ export class RequestMetadataForm extends React.Component<
name="column-description" name="column-description"
defaultChecked={colDescriptionNeeded} defaultChecked={colDescriptionNeeded}
/> />
{COLUMN_DESCRIPTIONS} {Constants.COLUMN_DESCRIPTIONS}
</label> </label>
</div> </div>
<div id="additional-comments-form-group" className="form-group"> <div id="additional-comments-form-group" className="form-group">
<label>{ADDITIONAL_DETAILS}</label> <label>{Constants.ADDITIONAL_DETAILS}</label>
<textarea <textarea
className="form-control" className="form-control"
name="comment" name="comment"
placeholder={ placeholder={
colDescriptionNeeded colDescriptionNeeded
? COMMENT_PLACEHOLDER_COLUMN ? Constants.COMMENT_PLACEHOLDER_COLUMN
: COMMENT_PLACEHOLDER_DEFAULT : Constants.COMMENT_PLACEHOLDER_DEFAULT
} }
required={colDescriptionNeeded} required={colDescriptionNeeded}
rows={8} rows={8}
...@@ -233,7 +222,7 @@ export class RequestMetadataForm extends React.Component< ...@@ -233,7 +222,7 @@ export class RequestMetadataForm extends React.Component<
type="submit" type="submit"
> >
<img className="icon icon-send" alt="" /> <img className="icon icon-send" alt="" />
{SEND_BUTTON} {Constants.SEND_BUTTON}
</button> </button>
</form> </form>
</div> </div>
......
import * as React from 'react'; import * as React from 'react';
import * as Constants from './constants';
import './styles.scss'; import './styles.scss';
...@@ -17,12 +18,9 @@ const FlashMessage: React.SFC<FlashMessageProps> = ({ ...@@ -17,12 +18,9 @@ const FlashMessage: React.SFC<FlashMessageProps> = ({
<div className="flash-message"> <div className="flash-message">
{iconClass && <img className={`icon ${iconClass}`} alt="" />} {iconClass && <img className={`icon ${iconClass}`} alt="" />}
<div className="message">{message}</div> <div className="message">{message}</div>
<button <button type="button" className="btn btn-close" onClick={onClose}>
type="button" <span className="sr-only">{Constants.CLOSE}</span>
className="btn btn-close" </button>
aria-label="Close"
onClick={onClose}
/>
</div> </div>
); );
}; };
......
...@@ -323,7 +323,6 @@ describe('SearchBar', () => { ...@@ -323,7 +323,6 @@ describe('SearchBar', () => {
it('renders input with correct default props', () => { it('renders input with correct default props', () => {
expect(wrapper.find('form').find('input').props()).toMatchObject({ expect(wrapper.find('form').find('input').props()).toMatchObject({
'aria-label': SearchBar.defaultProps.placeholder,
autoFocus: true, autoFocus: true,
className: 'h2 large search-bar-input form-control', className: 'h2 large search-bar-input form-control',
id: 'search-input', id: 'search-input',
...@@ -340,7 +339,6 @@ describe('SearchBar', () => { ...@@ -340,7 +339,6 @@ describe('SearchBar', () => {
searchTerm: 'data', searchTerm: 'data',
}); });
expect(wrapper.find('form').find('input').props()).toMatchObject({ expect(wrapper.find('form').find('input').props()).toMatchObject({
'aria-label': props.placeholder,
autoFocus: true, autoFocus: true,
className: 'h2 large search-bar-input form-control', className: 'h2 large search-bar-input form-control',
id: 'search-input', id: 'search-input',
......
...@@ -22,13 +22,7 @@ import InlineSearchResults from './InlineSearchResults'; ...@@ -22,13 +22,7 @@ import InlineSearchResults from './InlineSearchResults';
import './styles.scss'; import './styles.scss';
import { import * as Constants from './constants';
BUTTON_CLOSE_TEXT,
SEARCH_BUTTON_TEXT,
INVALID_SYNTAX_MESSAGE,
PLACEHOLDER_DEFAULT,
SIZE_SMALL,
} from './constants';
export interface StateFromProps { export interface StateFromProps {
searchTerm: string; searchTerm: string;
...@@ -64,7 +58,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -64,7 +58,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
private refToSelf: React.RefObject<HTMLDivElement>; private refToSelf: React.RefObject<HTMLDivElement>;
public static defaultProps: Partial<SearchBarProps> = { public static defaultProps: Partial<SearchBarProps> = {
placeholder: PLACEHOLDER_DEFAULT, placeholder: Constants.PLACEHOLDER_DEFAULT,
size: '', size: '',
}; };
...@@ -140,7 +134,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -140,7 +134,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
const isValid = searchTerm.indexOf(':') < 0; const isValid = searchTerm.indexOf(':') < 0;
/* This will set the error message, it must be explicitly set or cleared each time */ /* This will set the error message, it must be explicitly set or cleared each time */
input.setCustomValidity(isValid ? '' : INVALID_SYNTAX_MESSAGE); input.setCustomValidity(isValid ? '' : Constants.INVALID_SYNTAX_MESSAGE);
if (searchTerm.length > 0) { if (searchTerm.length > 0) {
/* This will show the error message */ /* This will show the error message */
...@@ -183,10 +177,10 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -183,10 +177,10 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
render() { render() {
const inputClass = `${ const inputClass = `${
this.props.size === SIZE_SMALL ? 'title-2 small' : 'h2 large' this.props.size === Constants.SIZE_SMALL ? 'title-2 small' : 'h2 large'
} search-bar-input form-control`; } search-bar-input form-control`;
const searchButtonClass = `btn btn-flat-icon search-button ${ const searchButtonClass = `btn btn-flat-icon search-button ${
this.props.size === SIZE_SMALL ? 'small' : 'large' this.props.size === Constants.SIZE_SMALL ? 'small' : 'large'
}`; }`;
return ( return (
...@@ -197,35 +191,36 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -197,35 +191,36 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
onSubmit={this.handleValueSubmit} onSubmit={this.handleValueSubmit}
> >
{/* eslint-disable jsx-a11y/no-autofocus */} {/* eslint-disable jsx-a11y/no-autofocus */}
<label className="sr-only">{this.props.placeholder}</label>
<input <input
id="search-input" id="search-input"
required required
className={inputClass} className={inputClass}
value={this.state.searchTerm} value={this.state.searchTerm}
onChange={this.handleValueChange} onChange={this.handleValueChange}
aria-label={this.props.placeholder}
placeholder={this.props.placeholder} placeholder={this.props.placeholder}
autoFocus autoFocus
autoComplete="off" autoComplete="off"
/> />
{/* eslint-enable jsx-a11y/no-autofocus */} {/* eslint-enable jsx-a11y/no-autofocus */}
<button className={searchButtonClass} type="submit"> <button className={searchButtonClass} type="submit">
<span className="sr-only">{SEARCH_BUTTON_TEXT}</span> <span className="sr-only">{Constants.SEARCH_BUTTON_TEXT}</span>
<img className="icon icon-search" alt="" /> <img className="icon icon-search" alt="" />
</button> </button>
{this.props.size === SIZE_SMALL && ( {this.props.size === Constants.SIZE_SMALL && (
<button <button
type="button" type="button"
className="btn btn-close clear-button" className="btn btn-close clear-button"
aria-label={BUTTON_CLOSE_TEXT}
onClick={this.clearSearchTerm} onClick={this.clearSearchTerm}
/> >
<span className="sr-only">{Constants.BUTTON_CLOSE_TEXT}</span>
</button>
)} )}
</form> </form>
{this.state.showTypeAhead && ( {this.state.showTypeAhead && (
// @ts-ignore: Investigate proper configuration for 'className' to be valid by default on custom components // @ts-ignore: Investigate proper configuration for 'className' to be valid by default on custom components
<InlineSearchResults <InlineSearchResults
className={this.props.size === SIZE_SMALL ? 'small' : ''} className={this.props.size === Constants.SIZE_SMALL ? 'small' : ''}
onItemSelect={this.onSelectInlineResult} onItemSelect={this.onSelectInlineResult}
searchTerm={this.state.searchTerm} searchTerm={this.state.searchTerm}
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment