Fixed styles for filters select (#2614)

* Fixed styles for filters select

* Added CHANGELOG

* Aborted style changes

* Aborted style changes

* Aborted version

* Fixed couple of bugs

* Updated version

Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
main
Dmitry Kalinin 5 years ago committed by GitHub
parent f84c128fa4
commit ff85fe0006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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>) - 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>) - 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>) - 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 ### Security

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.13.4", "version": "1.13.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.13.4", "version": "1.13.5",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation // Copyright (C) 2020-2021 Intel Corporation
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@ -120,7 +120,8 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
changeAnnotationsFilters, changeAnnotationsFilters,
} = props; } = props;
const [underCursor, setUnderCursor] = useState(false); const [underCursor, setUnderCursor] = useState<boolean>(false);
const [dropdownVisible, setDropdownVisible] = useState<boolean>(true);
return ( return (
<Select <Select
@ -128,20 +129,27 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
allowClear allowClear
value={annotationsFilters} value={annotationsFilters}
mode='tags' mode='tags'
disabled={!dropdownVisible}
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder={ placeholder={
underCursor ? ( underCursor ? (
<> <>
<Tooltip title='Click to open help' mouseLeaveDelay={0}> <Tooltip title='Click to open help' mouseLeaveDelay={0}>
<FilterOutlined <FilterOutlined
onClick={(e: React.MouseEvent) => { style={{ pointerEvents: 'all' }}
e.stopPropagation(); 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({ Modal.info({
width: 700, width: 700,
title: 'How to use filters?', title: 'How to use filters?',
content: filtersHelpModalContent(searchForwardShortcut, searchBackwardShortcut), content: filtersHelpModalContent(searchForwardShortcut, searchBackwardShortcut),
}); });
}} }}
onMouseEnter={() => setDropdownVisible(false)}
onMouseLeave={() => setDropdownVisible(true)}
/> />
</Tooltip> </Tooltip>
</> </>
@ -158,7 +166,11 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
> >
{annotationsFiltersHistory.map( {annotationsFiltersHistory.map(
(element: string): JSX.Element => ( (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} {element}
</Select.Option> </Select.Option>
), ),

@ -280,15 +280,14 @@
} }
} }
.cvat-annotations-filters-input.ant-select > div { .cvat-annotations-filters-input.ant-select {
height: 32px; > .ant-select-selector {
> div {
height: 32px; height: 32px;
overflow: auto;
}
ul { > .ant-select-clear {
display: flex; right: 20px;
}
} }
} }

Loading…
Cancel
Save