mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-18 22:44:26 +01:00
update
This commit is contained in:
@@ -7,7 +7,7 @@ type UseHandleCommandProps = {
|
||||
|
||||
type CommandBase<T> = { command: T };
|
||||
|
||||
export type OpenPostForm = CommandBase<'openPostForm'>;
|
||||
export type OpenPostForm = CommandBase<'openPostForm'> & { content?: string };
|
||||
export type ClosePostForm = CommandBase<'closePostForm'>;
|
||||
export type MoveToNextItem = CommandBase<'moveToNextItem'>;
|
||||
export type MoveToPrevItem = CommandBase<'moveToPrevItem'>;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { createSignal, onMount } from 'solid-js';
|
||||
|
||||
// TODO Find a better way to solve this. Firefox on Windows can cause 2px gap.
|
||||
const Offset = 2;
|
||||
|
||||
const useDetectOverflow = () => {
|
||||
let elementRef: HTMLElement | undefined;
|
||||
const [overflow, setOverflow] = createSignal(false);
|
||||
@@ -10,7 +13,7 @@ const useDetectOverflow = () => {
|
||||
|
||||
onMount(() => {
|
||||
if (elementRef != null) {
|
||||
setOverflow(elementRef.scrollHeight > elementRef.clientHeight);
|
||||
setOverflow(elementRef.scrollHeight > elementRef.clientHeight + Offset);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user