Skip to content

fix(Popup): fix ability to not hide popup on scroll #4490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/modules/Popup/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const Popup = React.forwardRef(function (props, ref) {
eventsEnabled = true,
flowing,
header,
hideOnScroll,
inverted,
offset,
pinned = false,
Expand Down Expand Up @@ -179,8 +180,8 @@ const Popup = React.forwardRef(function (props, ref) {
_.invoke(props, 'onOpen', e, { ...props, open: true })
}

const hideOnScroll = (e) => {
debug('hideOnScroll()')
const handleHideOnScroll = (e) => {
debug('handleHideOnScroll()')

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

Expand Down
Loading