Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryptoMetrics_L02_GRP15
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
L02_GRP15
CryptoMetrics_L02_GRP15
Commits
0ec64b0e
Commit
0ec64b0e
authored
3 years ago
by
Aggarwal Himanshu
Browse files
Options
Downloads
Patches
Plain Diff
Fix CSSTransition ref error
parent
d49fe64f
No related branches found
No related tags found
2 merge requests
!17
Merge develop into main
,
!12
Filter Enhancements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cryptometrics/components/dropdown/FilterDropdown.js
+7
-4
7 additions, 4 deletions
src/cryptometrics/components/dropdown/FilterDropdown.js
with
7 additions
and
4 deletions
src/cryptometrics/components/dropdown/FilterDropdown.js
+
7
−
4
View file @
0ec64b0e
import
{
ArrowRightIcon
}
from
"
@heroicons/react/outline
"
;
import
classNames
from
"
classnames
"
;
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"
react
"
;
import
Button
from
"
../button/Button
"
;
import
{
RadioInputForm
}
from
"
../radio/RadioForm
"
;
import
{
CSSTransition
}
from
"
react-transition-group
"
;
...
...
@@ -14,6 +14,7 @@ export function FilterDropdown({
const
[
selectedFilter
,
setSelectedFilter
]
=
useState
(
null
);
const
[
radioValue
,
setRadioValue
]
=
useState
(
"
is
"
);
const
[
inputValue
,
setInputValue
]
=
useState
(
""
);
const
secondaryDropdownRef
=
useRef
(
null
);
useEffect
(()
=>
{
if
(
selectedFilter
)
{
...
...
@@ -67,13 +68,14 @@ export function FilterDropdown({
)}
<
/div
>
<
CSSTransition
in
=
{
selectedFilter
}
in
=
{
selectedFilter
!==
null
}
classNames
=
"
secondary-dropdown
"
timeout
=
{
300
}
unmountOnExit
nodeRef
=
{
secondaryDropdownRef
}
>
{
selectedFilter
?
(
<
span
className
=
"
ml-3
"
>
<
span
className
=
"
ml-3
"
ref
=
{
secondaryDropdownRef
}
>
<
SecondaryFilterDropdown
open
=
{
true
}
onSelectedFilterChange
=
{
onSelectedFilterChange
}
...
...
@@ -89,7 +91,7 @@ export function FilterDropdown({
/
>
<
/span
>
)
:
(
<
div
><
/div
>
<
div
ref
=
{
secondaryDropdownRef
}
><
/div
>
)}
<
/CSSTransition
>
<
/div
>
...
...
@@ -141,6 +143,7 @@ export function SecondaryFilterDropdown({
className
=
"
bg-indigo-600 text-white font-semibold w-full
"
onClick
=
{
onFilterAdd
}
type
=
"
submit
"
disabled
=
{
inputValue
===
""
}
>
Filter
<
/Button
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment