Skip to content

Commit cf46d45

Browse files
committed
fix(Popup): fix ability to not hide popup on scroll
1 parent 1623c8d commit cf46d45

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/Popup/Popup.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const Popup = React.forwardRef(function (props, ref) {
124124
eventsEnabled = true,
125125
flowing,
126126
header,
127+
hideOnScroll,
127128
inverted,
128129
offset,
129130
pinned = false,
@@ -179,8 +180,8 @@ const Popup = React.forwardRef(function (props, ref) {
179180
_.invoke(props, 'onOpen', e, { ...props, open: true })
180181
}
181182

182-
const hideOnScroll = (e) => {
183-
debug('hideOnScroll()')
183+
const handleHideOnScroll = (e) => {
184+
debug('handleHideOnScroll()')
184185

185186
// Do not hide the popup when scroll comes from inside the popup
186187
// https://github.com/Semantic-Org/Semantic-UI-React/issues/4305
@@ -253,7 +254,7 @@ const Popup = React.forwardRef(function (props, ref) {
253254
) : (
254255
children
255256
)}
256-
{hideOnScroll && <EventStack on={hideOnScroll} name='scroll' target='window' />}
257+
{hideOnScroll && <EventStack on={handleHideOnScroll} name='scroll' target='window' />}
257258
</ElementType>
258259
)
259260

0 commit comments

Comments
 (0)