Skip to content

Commit b6234db

Browse files
chore: replace deprecated useKeyOnly with getKeyOnly in modules/Dropdown
1 parent bdc6129 commit b6234db

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

src/modules/Dropdown/Dropdown.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
makeDebugger,
1717
objectDiff,
1818
setRef,
19-
useKeyOnly,
20-
useKeyOrValueAndKey,
19+
getKeyOnly,
20+
getKeyOrValueAndKey,
2121
} from '../../lib'
2222
import Icon from '../../elements/Icon'
2323
import Label from '../../elements/Label'
@@ -1051,7 +1051,7 @@ class DropdownInner extends Component {
10511051
// single menu child
10521052
if (!childrenUtils.isNil(children)) {
10531053
const menuChild = Children.only(children)
1054-
const className = cx(direction, useKeyOnly(open, 'visible'), menuChild.props.className)
1054+
const className = cx(direction, getKeyOnly(open, 'visible'), menuChild.props.className)
10551055

10561056
return cloneElement(menuChild, { className, ...ariaOptions })
10571057
}
@@ -1096,31 +1096,31 @@ class DropdownInner extends Component {
10961096
// Classes
10971097
const classes = cx(
10981098
'ui',
1099-
useKeyOnly(open, 'active visible'),
1100-
useKeyOnly(disabled, 'disabled'),
1101-
useKeyOnly(error, 'error'),
1102-
useKeyOnly(loading, 'loading'),
1103-
1104-
useKeyOnly(basic, 'basic'),
1105-
useKeyOnly(button, 'button'),
1106-
useKeyOnly(compact, 'compact'),
1107-
useKeyOnly(fluid, 'fluid'),
1108-
useKeyOnly(floating, 'floating'),
1109-
useKeyOnly(inline, 'inline'),
1099+
getKeyOnly(open, 'active visible'),
1100+
getKeyOnly(disabled, 'disabled'),
1101+
getKeyOnly(error, 'error'),
1102+
getKeyOnly(loading, 'loading'),
1103+
1104+
getKeyOnly(basic, 'basic'),
1105+
getKeyOnly(button, 'button'),
1106+
getKeyOnly(compact, 'compact'),
1107+
getKeyOnly(fluid, 'fluid'),
1108+
getKeyOnly(floating, 'floating'),
1109+
getKeyOnly(inline, 'inline'),
11101110
// TODO: consider augmentation to render Dropdowns as Button/Menu, solves icon/link item issues
11111111
// https://github.com/Semantic-Org/Semantic-UI-React/issues/401#issuecomment-240487229
11121112
// TODO: the icon class is only required when a dropdown is a button
1113-
// useKeyOnly(icon, 'icon'),
1114-
useKeyOnly(labeled, 'labeled'),
1115-
useKeyOnly(item, 'item'),
1116-
useKeyOnly(multiple, 'multiple'),
1117-
useKeyOnly(search, 'search'),
1118-
useKeyOnly(selection, 'selection'),
1119-
useKeyOnly(simple, 'simple'),
1120-
useKeyOnly(scrolling, 'scrolling'),
1121-
useKeyOnly(upward, 'upward'),
1122-
1123-
useKeyOrValueAndKey(pointing, 'pointing'),
1113+
// getKeyOnly(icon, 'icon'),
1114+
getKeyOnly(labeled, 'labeled'),
1115+
getKeyOnly(item, 'item'),
1116+
getKeyOnly(multiple, 'multiple'),
1117+
getKeyOnly(search, 'search'),
1118+
getKeyOnly(selection, 'selection'),
1119+
getKeyOnly(simple, 'simple'),
1120+
getKeyOnly(scrolling, 'scrolling'),
1121+
getKeyOnly(upward, 'upward'),
1122+
1123+
getKeyOrValueAndKey(pointing, 'pointing'),
11241124
'dropdown',
11251125
className,
11261126
)

src/modules/Dropdown/DropdownItem.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
customPropTypes,
1111
getComponentType,
1212
getUnhandledProps,
13-
useKeyOnly,
13+
getKeyOnly,
1414
} from '../../lib'
1515
import Flag from '../../elements/Flag'
1616
import Icon from '../../elements/Icon'
@@ -41,9 +41,9 @@ const DropdownItem = React.forwardRef(function (props, ref) {
4141
}
4242

4343
const classes = cx(
44-
useKeyOnly(active, 'active'),
45-
useKeyOnly(disabled, 'disabled'),
46-
useKeyOnly(selected, 'selected'),
44+
getKeyOnly(active, 'active'),
45+
getKeyOnly(disabled, 'disabled'),
46+
getKeyOnly(selected, 'selected'),
4747
'item',
4848
className,
4949
)

src/modules/Dropdown/DropdownMenu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
customPropTypes,
88
getComponentType,
99
getUnhandledProps,
10-
useKeyOnly,
10+
getKeyOnly,
1111
} from '../../lib'
1212

1313
/**
@@ -18,8 +18,8 @@ const DropdownMenu = React.forwardRef(function (props, ref) {
1818

1919
const classes = cx(
2020
direction,
21-
useKeyOnly(open, 'visible'),
22-
useKeyOnly(scrolling, 'scrolling'),
21+
getKeyOnly(open, 'visible'),
22+
getKeyOnly(scrolling, 'scrolling'),
2323
'menu transition',
2424
className,
2525
)

0 commit comments

Comments
 (0)