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: Make popup on the Search input field less intrusive enhancement #1685

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,18 @@ limitations under the License.
.TracePageSearchBar--locateBtn {
padding: 1px 8px 4px;
}
.help-btn-container {
border: 1px solid gainsboro;
padding: 3px 7px;
}
.help-btn-container:hover {
border-top-color: rgb(23, 184, 190);
border-bottom-color: rgb(23, 184, 190);
}
.help-button {
border: 1px solid #999;
border-radius: 100px;
color: #999;
cursor: pointer;
padding: 1px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import { Button, Input, Tooltip } from 'antd';
import cx from 'classnames';
import IoAndroidLocate from 'react-icons/lib/io/android-locate';

import IoHelp from 'react-icons/lib/io/help';
import * as markers from './TracePageSearchBar.markers';
import { trackFilter } from '../index.track';
import UiFindInput from '../../common/UiFindInput';
import { TNil } from '../../../types';

import './TracePageSearchBar.css';

type TracePageSearchBarProps = {
Expand Down Expand Up @@ -80,55 +80,58 @@ export function TracePageSearchBarFn(props: TracePageSearchBarProps & { forwarde

return (
<div className="TracePageSearchBar">
<Tooltip
arrowPointAtCenter
mouseLeaveDelay={0.5}
placement="bottom"
overlayStyle={{ maxWidth: '600px' }} // This is a large tooltip and the default is too narrow.
title={renderTooltip()}
>
{/* style inline because compact overwrites the display */}
<Input.Group className="ub-justify-end" compact style={{ display: 'flex' }}>
<UiFindInput
inputProps={uiFindInputInputProps}
forwardedRef={forwardedRef}
trackFindFunction={trackFilter}
/>
{navigable && (
<>
<Button
className={cx(btnClass, 'TracePageSearchBar--locateBtn')}
disabled={!textFilter}
htmlType="button"
onClick={focusUiFindMatches}
>
<IoAndroidLocate />
</Button>
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="up"
onClick={prevResult}
/>
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="down"
onClick={nextResult}
/>
</>
)}
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="close"
onClick={clearSearch}
/>
</Input.Group>
</Tooltip>
{/* style inline because compact overwrites the display */}
<Input.Group className="ub-justify-end" compact style={{ display: 'flex' }}>
<UiFindInput
inputProps={uiFindInputInputProps}
forwardedRef={forwardedRef}
trackFindFunction={trackFilter}
/>
<Tooltip
arrowPointAtCenter
placement="bottomLeft"
trigger="hover"
overlayStyle={{ maxWidth: '600px' }} // This is a large tooltip and the default is too narrow.
title={renderTooltip()}
>
<div className="help-btn-container">
<IoHelp className="help-button" />
</div>
</Tooltip>
{navigable && (
<>
<Button
className={cx(btnClass, 'TracePageSearchBar--locateBtn')}
disabled={!textFilter}
htmlType="button"
onClick={focusUiFindMatches}
>
<IoAndroidLocate />
</Button>
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="up"
onClick={prevResult}
/>
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="down"
onClick={nextResult}
/>
</>
)}
<Button
className={btnClass}
disabled={!textFilter}
htmlType="button"
icon="close"
onClick={clearSearch}
/>
</Input.Group>
</div>
);
}
Expand Down