Skip to content

useScrollHide

A composable for handling scroll events to automatically hide dropdown/menu components when scrolling occurs.

Returns

  • componentRef (Ref) - Reference to the component
  • onShow (Function) - Call when component shows
  • onHide (Function) - Call when component hides

Usage

vue
<template>
  <q-select
    ref="selectRef"
    @popup-show="onShow"
    @popup-hide="onHide"
  />
</template>

<script setup>
import { useScrollHide } from '@ftx/ui';

const { componentRef, onShow, onHide } = useScrollHide();
</script>

Note

This composable is automatically used by FTxQSelect, FTxQMenu, and FTxBtnDropdown components, so you typically don't need to use it directly.

Released under the MIT License.