mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 14:04:21 +01:00
fix: stop caching popup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createMemo, children } from 'solid-js';
|
||||
import { createMemo } from 'solid-js';
|
||||
|
||||
import { Picker } from 'emoji-mart';
|
||||
|
||||
@@ -28,7 +28,7 @@ const useEmojiPicker = (propsProvider: () => UseEmojiPickerProps) => {
|
||||
|
||||
let popup: UsePopup | undefined;
|
||||
|
||||
const pickerElement = children(() => {
|
||||
const pickerElement = () => {
|
||||
const customEmojis = Object.entries(config().customEmojis).map(([name, { url }]) => ({
|
||||
id: name,
|
||||
name,
|
||||
@@ -66,7 +66,7 @@ const useEmojiPicker = (propsProvider: () => UseEmojiPickerProps) => {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return picker as any as HTMLElement;
|
||||
});
|
||||
};
|
||||
|
||||
popup = usePopup(() => ({
|
||||
position: 'bottom',
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
import {
|
||||
createSignal,
|
||||
createEffect,
|
||||
createMemo,
|
||||
onCleanup,
|
||||
children,
|
||||
Show,
|
||||
type JSX,
|
||||
} from 'solid-js';
|
||||
import { createSignal, createEffect, createMemo, onCleanup, Show, type JSX } from 'solid-js';
|
||||
|
||||
import { Portal } from 'solid-js/web';
|
||||
|
||||
@@ -31,13 +23,13 @@ const usePopup = (propsProvider: () => UsePopupProps): UsePopup => {
|
||||
const [style, setStyle] = createSignal<JSX.CSSProperties>({});
|
||||
const [isOpen, setIsOpen] = createSignal(false);
|
||||
|
||||
const resolvedChildren = children(() => {
|
||||
const resolvedChildren = () => {
|
||||
const { popup } = props();
|
||||
if (typeof popup === 'function') {
|
||||
return popup();
|
||||
}
|
||||
return popup;
|
||||
});
|
||||
};
|
||||
|
||||
const open = () => setIsOpen(true);
|
||||
const close = () => setIsOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user