Skip to content

Commit

Permalink
type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Sep 22, 2020
1 parent a5c8775 commit 369b505
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function SelectableUrlList({
const [popoverRef, setPopoverRef] = useState<HTMLElement | null>(null);
const [searchRef, setSearchRef] = useState<HTMLInputElement | null>(null);

const titleRef = useRef();
const titleRef = useRef<HTMLDivElement>(null);

const searchOnFocus = (e: React.FocusEvent<HTMLInputElement>) => {
setPopoverIsOpen(true);
Expand All @@ -62,7 +62,7 @@ export function SelectableUrlList({
const searchOnBlur = (e: React.FocusEvent<HTMLInputElement>) => {
if (
!popoverRef?.contains(e.relatedTarget as HTMLElement) &&
!popoverRef?.contains(titleRef.current as HTMLElement)
!popoverRef?.contains(titleRef.current as HTMLDivElement)
) {
setPopoverIsOpen(false);
}
Expand All @@ -82,13 +82,13 @@ export function SelectableUrlList({
<EuiSelectableMessage style={{ minHeight: 300 }}>
<EuiLoadingSpinner size="l" />
<br />
<p>Loading results</p>
<p>{I18LABELS.loadingResults}</p>
</EuiSelectableMessage>
);

const emptyMessage = (
<EuiSelectableMessage style={{ minHeight: 300 }}>
<p>No results available</p>
<p>{I18LABELS.noResults}</p>
</EuiSelectableMessage>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ export const I18LABELS = {
matchThisQuery: i18n.translate('xpack.apm.rum.filters.url.matchThisQuery', {
defaultMessage: 'Match this query',
}),
loadingResults: i18n.translate('xpack.apm.rum.filters.url.loadingResults', {
defaultMessage: 'Loading results',
}),
noResults: i18n.translate('xpack.apm.rum.filters.url.noResults', {
defaultMessage: 'No results available',
}),
};

export const VisitorBreakdownLabel = i18n.translate(
Expand Down

0 comments on commit 369b505

Please sign in to comment.