Skip to content

Commit f8169d1

Browse files
authored
Recovered drop-down default button action (#32)
* recovered default action * 1.0.20
1 parent 2aac9ed commit f8169d1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dynamods/dynamo-home",
3-
"version": "1.0.19",
3+
"version": "1.0.20",
44
"description": "Dynamo Home",
55
"author": "Autodesk Inc.",
66
"main": "index.tsx",

src/components/Sidebar/CustomDropDown.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const CustomDropdown = ({
2222
const dropdownRef = useRef(null);
2323
const arrowColor = isOpen ? "rgba(56,171,223,0.35)" : "#949494";
2424

25-
const toggleDropdown = () => setIsOpen(!isOpen);
25+
const toggleDropdown = () => setIsOpen(!isOpen);
2626

2727
/** Peforms the selected action type when used as a Drop-down */
2828
const handleOptionSelect = (option: option) => {
@@ -67,18 +67,20 @@ export const CustomDropdown = ({
6767
ref={dropdownRef}>
6868
<div
6969
className={styles['dropdown-selected']}
70-
onClick={wholeButtonActionable ? toggleDropdown : undefined}
70+
onClick={wholeButtonActionable ? toggleDropdown : handleDefaultAction} // Button behavior depends on wholeButtonActionable
7171
>
72-
<span>{placeholder}</span>
72+
<span>{placeholder}</span>
7373
{showDivider && <span className={styles['vertical-line']}></span>}
7474
<div
7575
className={styles['arrow-container']}
76-
onClick={wholeButtonActionable ? undefined : (e) => {
76+
onClick={(e) => {
7777
e.stopPropagation();
78-
toggleDropdown();
78+
toggleDropdown(); // Arrow always toggles the dropdown
7979
}}
8080
>
81-
<OpenArrow isOpen={isOpen} color={arrowColor} />
81+
<div style={{ marginTop: 4 }}>
82+
<OpenArrow isOpen={isOpen} color={arrowColor} />
83+
</div>
8284
</div>
8385
</div>
8486
<div className={`${styles['dropdown-options']} ${isOpen ? styles.open : ''}`}>

0 commit comments

Comments
 (0)