-
Notifications
You must be signed in to change notification settings - Fork 193
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.0-react #2064 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 33 35 +2
Lines 211 234 +23
Branches 33 37 +4
===========================================
+ Hits 211 234 +23
Continue to review full report at Codecov.
|
/* | ||
* Toggle & hide dropdown content. | ||
*/ | ||
const toggle = () => setIsOpen(!isOpen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think toggle
and hide
are not clear enough in this case and you feel like you need a comment you should maybe rename it to something like toggleContent
and hideContent
.
* Hide dropdown upon option click. | ||
* Call `onSelect` and close dropdown. | ||
*/ | ||
const select = (option: Option) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as toggle
and hide
. If you feel the need for a comment because the method names or code give no indication of what is happening you should rename them or make it more clear otherwise.
* Hook to hide dropdown on outside click event. | ||
*/ | ||
const ref = useRef(null); | ||
useEffect(() => clickOutsideHandler(ref, hide), [ref]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as toggle
and hide
. If you feel the need for a comment because the method names or code give no indication of what is happening you should rename them or make it more clear otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary indeed. Removed them.
Summary
General-purpose
Dropdown
component.[{label: 'Option 1', value: '1'}]
- TriggersonSelect
event<Dropdown>custom content</Dropdown>
toggleIcon
prop<Dropdown iconName="settings">custom content</Dropdown>
Checklist