-
Notifications
You must be signed in to change notification settings - Fork 474
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 scroll issue in shifting in facilities. #9268
base: develop
Are you sure you want to change the base?
Changes from 2 commits
fcaf7f5
9a6a1d9
4dd6525
60ba91e
25bed76
e22701b
e949a5f
02ccceb
69d5519
c7ef408
f555c30
1cb7131
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
* text=auto | ||
|
||
|
||
*.c text | ||
*.h text | ||
|
||
*.sln text eol=crlf | ||
|
||
*.png binary | ||
*.jpg binary |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// src/CAREUI/display/ScrollableColumn.tsx | ||
import React from "react"; | ||
|
||
interface ScrollableColumnProps { | ||
title: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
const ScrollableColumn: React.FC<ScrollableColumnProps> = ({ | ||
title, | ||
children, | ||
}) => { | ||
return ( | ||
<div | ||
style={{ | ||
height: "400px", | ||
overflowY: "auto", | ||
border: "1px solid #ccc", | ||
margin: "10px", | ||
}} | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Make the component more flexible and accessible The component could benefit from the following improvements:
<div
+ role="region"
+ aria-label={title}
style={{
- height: "400px",
+ height: props.height || "400px",
overflowY: "auto",
border: "1px solid #ccc",
margin: "10px",
+ ...props.style,
}}
+ className={props.className}
> Update the props interface accordingly: interface ScrollableColumnProps {
title: string;
children: React.ReactNode;
height?: string;
style?: React.CSSProperties;
className?: string;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<h3>{title}</h3> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ScrollableColumn; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; | ||
import * as React from "react"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
const ScrollArea = React.forwardRef< | ||
React.ElementRef<typeof ScrollAreaPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> | ||
>(({ className, children, ...props }, ref) => ( | ||
<ScrollAreaPrimitive.Root | ||
ref={ref} | ||
className={cn("relative overflow-hidden", className)} | ||
{...props} | ||
> | ||
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]"> | ||
{children} | ||
</ScrollAreaPrimitive.Viewport> | ||
<ScrollBar /> | ||
<ScrollAreaPrimitive.Corner /> | ||
</ScrollAreaPrimitive.Root> | ||
)); | ||
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; | ||
|
||
const ScrollBar = React.forwardRef< | ||
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>, | ||
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar> | ||
>(({ className, orientation = "vertical", ...props }, ref) => ( | ||
<ScrollAreaPrimitive.ScrollAreaScrollbar | ||
ref={ref} | ||
orientation={orientation} | ||
className={cn( | ||
"flex touch-none select-none transition-colors", | ||
orientation === "vertical" && | ||
"h-full w-2.5 border-l border-l-transparent p-[1px]", | ||
orientation === "horizontal" && | ||
"h-2.5 flex-col border-t border-t-transparent p-[1px]", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-gray-200 dark:bg-gray-800" /> | ||
</ScrollAreaPrimitive.ScrollAreaScrollbar> | ||
)); | ||
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; | ||
|
||
export { ScrollArea, ScrollBar }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#9223 has solved issues with line endings on windows. Ensure proper line endings by using latest develop branch.