Skip to content
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

fixed lost of date after closing the panel in IX #6879

Merged
merged 2 commits into from
Jun 11, 2024
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
8 changes: 3 additions & 5 deletions app/react/V2/Routes/Settings/IX/components/PDFSidepanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,8 @@ const PDFSidepanel = ({
}, [pdf, setValue, showSidepanel, suggestion]);

useEffect(() => {
console.log('pdfContainerRef', pdfContainerRef);
if (pdfContainerRef.current) {
const { height } = pdfContainerRef.current.getBoundingClientRect();
console.log('height', height);
setPdfContainerHeight(height);
}
}, [labelInputIsOpen, pdfContainerRef.current]);
Expand Down Expand Up @@ -313,7 +311,7 @@ const PDFSidepanel = ({
}
const inputType = type === 'numeric' ? 'number' : type;
return (
<div className="relative flex gap-2 px-4 pb-4 grow">
<div className={`relative flex gap-2 px-4 pb-4 grow ${labelInputIsOpen ? '' : 'hidden'}`}>
<div className="grow">
<InputField
clearFieldAction={() => {
Expand Down Expand Up @@ -380,7 +378,7 @@ const PDFSidepanel = ({
});

return (
<div className="px-4 pb-4 overflow-y-scroll grow">
<div className={`px-4 pb-4 overflow-y-scroll grow ${labelInputIsOpen ? '' : 'hidden'}`}>
<MultiselectList
onChange={values => {
setValue('field', values, { shouldDirty: true });
Expand Down Expand Up @@ -462,7 +460,7 @@ const PDFSidepanel = ({
{labelInputIsOpen ? <ChevronDownIcon width={20} /> : <ChevronUpIcon width={20} />}
</span>
</div>
{labelInputIsOpen && renderLabel()}
{renderLabel()}
<div className="sticky bottom-0 flex justify-end gap-2 px-4 py-2 bg-white border border-b-0 border-l-0 border-r-0 border-gray-200 border-t-1">
<Button
type="button"
Expand Down
Loading