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

[Bug] Text in checklist description is not easy to read #551

Merged
Show file tree
Hide file tree
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
23 changes: 16 additions & 7 deletions js/src/components/check/CheckDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ export function CheckDescription({ value, onChange }: CheckDescriptionProps) {
setEditing(true);
};

const handleKeyDown: KeyboardEventHandler = (event) => {
if (event.key === "Escape") {
setEditing(false);
}
};

const handleCancel = () => {
setTimeout(() => {
setEditing(false);
Expand All @@ -41,6 +35,19 @@ export function CheckDescription({ value, onChange }: CheckDescriptionProps) {
}
};

const handleKeyDown: KeyboardEventHandler = (event) => {
if (event.key === "Escape") {
setEditing(false);
}
if (
(event.metaKey || event.ctrlKey) && // mac: cmd, windows: ctrl
event.key === "Enter"
) {
event.preventDefault();
handleUpdate();
}
};

const handleChange: ChangeEventHandler = (event) => {
setTempValue((event.target as any).value);
};
Expand Down Expand Up @@ -77,10 +84,12 @@ export function CheckDescription({ value, onChange }: CheckDescriptionProps) {

return (
<Text
height="100%"
overflow="auto"
fontSize="11pt"
onClick={handleEdit}
whiteSpace="pre"
whiteSpace="pre-wrap"
wordBreak="break-word"
color={!value ? "lightgray" : "inherit"}
>
{!value ? "Add description here" : value}
Expand Down
9 changes: 2 additions & 7 deletions js/src/components/check/CheckDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,8 @@ export const CheckDetail = ({ checkId }: CheckDetailProps) => {
sizes={[30, 70]}
style={{ height: "100%", width: "100%", maxHeight: "100%" }}
>
<Box
style={{ contain: "strict" }}
display="flex"
flexDirection="column"
overflow="auto"
>
<Flex p="0px 16px" alignItems="center">
<Box style={{ contain: "strict" }} display="flex" flexDirection="column">
<Flex p="0px 16px" alignItems="center" h="40px">
<CheckBreadcrumb
name={check?.name || ""}
setName={(name) => {
Expand Down
Loading