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

Fixed styles for filters select #2614

Merged
merged 8 commits into from
Jan 20, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Kibana startup initialization (<https://github.com/openvinotoolkit/cvat/pull/2659>)
- The cursor jumps to the end of the line when renaming a task (<https://github.com/openvinotoolkit/cvat/pull/2669>)
- SSLCertVerificationError when remote source is used (<https://github.com/openvinotoolkit/cvat/pull/2683>)
- Fixed filters select overflow (<https://github.com/openvinotoolkit/cvat/pull/2614>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.13.4",
"version": "1.13.5",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2020-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -120,28 +120,36 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
changeAnnotationsFilters,
} = props;

const [underCursor, setUnderCursor] = useState(false);
const [underCursor, setUnderCursor] = useState<boolean>(false);
const [dropdownVisible, setDropdownVisible] = useState<boolean>(true);

return (
<Select
className='cvat-annotations-filters-input'
allowClear
value={annotationsFilters}
mode='tags'
disabled={!dropdownVisible}
style={{ width: '100%' }}
placeholder={
underCursor ? (
<>
<Tooltip title='Click to open help' mouseLeaveDelay={0}>
<FilterOutlined
onClick={(e: React.MouseEvent) => {
e.stopPropagation();
style={{ pointerEvents: 'all' }}
onClick={() => {
// also opens the select dropdown
// looks like it is done on capturing state
// so we cannot cancel it somehow via the event handling
// to avoid it we use also onMouseEnter, onMouseLeave below
Modal.info({
width: 700,
title: 'How to use filters?',
content: filtersHelpModalContent(searchForwardShortcut, searchBackwardShortcut),
});
}}
onMouseEnter={() => setDropdownVisible(false)}
onMouseLeave={() => setDropdownVisible(true)}
/>
</Tooltip>
</>
Expand All @@ -158,7 +166,11 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
>
{annotationsFiltersHistory.map(
(element: string): JSX.Element => (
<Select.Option key={element} value={element} className='cvat-annotations-filters-input-history-element'>
<Select.Option
key={element}
value={element}
className='cvat-annotations-filters-input-history-element'
>
{element}
</Select.Option>
),
Expand Down
13 changes: 6 additions & 7 deletions cvat-ui/src/components/annotation-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,14 @@
}
}

.cvat-annotations-filters-input.ant-select > div {
height: 32px;

> div {
.cvat-annotations-filters-input.ant-select {
> .ant-select-selector {
height: 32px;
overflow: auto;
}

ul {
display: flex;
}
> .ant-select-clear {
right: 20px;
}
}

Expand Down