Skip to content

Commit

Permalink
fix(desktop): set userSelect to text instead of auto to fix an issue (l…
Browse files Browse the repository at this point in the history
…oft-sh#1472)

where users were not able to select text in DevPod Desktop
  • Loading branch information
pascalbreuninger authored Dec 13, 2024
1 parent f835c0b commit 3092dd6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions desktop/src/Theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Link = defineStyleConfig({
const FormError = defineStyleConfig({
baseStyle: {
text: {
userSelect: "auto",
userSelect: "text",
cursor: "text",
},
},
Expand Down Expand Up @@ -71,10 +71,10 @@ export const theme = extendTheme({
cursor: "default",
},
td: {
userSelect: "auto",
userSelect: "text",
},
code: {
userSelect: "auto",
userSelect: "text",
cursor: "text",
},
"input::placeholder": {
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/components/Error/ErrorMessageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function ErrorMessageBox({ error, ...boxProps }: TErrorMessageBox) {
borderRadius="md"
display="inline-block"
{...boxProps}>
<Text userSelect="auto" cursor="text" color={textColor} fontFamily="monospace">
<Text userSelect="text" cursor="text" color={textColor} fontFamily="monospace">
{error.message.split("\n").map((line, index) => (
<React.Fragment key={index}>
{line}
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/components/Warning/WarningMessageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function WarningMessageBox({
borderRadius: "md",
}
: {})}
userSelect="auto"
userSelect="text"
display="inline-block">
<Text color={textColor} fontSize={fontSize}>
{warning}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function OptionFormField({
{exists(optionError) ? (
<FormErrorMessage>{optionError.message?.toString() ?? "Error"}</FormErrorMessage>
) : (
exists(description) && <FormHelperText userSelect="auto">{description}</FormHelperText>
exists(description) && <FormHelperText userSelect="text">{description}</FormHelperText>
)}

{input}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function OptionFormField({
{exists(optionError) ? (
<FormErrorMessage>{optionError.message?.toString() ?? "Error"}</FormErrorMessage>
) : (
exists(description) && <FormHelperText userSelect="auto">{description}</FormHelperText>
exists(description) && <FormHelperText userSelect="text">{description}</FormHelperText>
)}
</FormControl>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function ProviderOptionList({ options }: TProviderOptionListProps) {
width="full"
overflowX="hidden"
color={valueColor}
userSelect="auto"
userSelect="text"
_hover={{ overflow: "visible", cursor: "text" }}>
{option.enum.find((e) => e.value === value)?.displayName ?? value}
</Text>
Expand All @@ -208,7 +208,7 @@ function ProviderOptionList({ options }: TProviderOptionListProps) {
width="full"
overflowX="hidden"
color={valueColor}
userSelect="auto"
userSelect="text"
_hover={{ overflow: "visible", cursor: "text" }}>
{value}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/views/Workspaces/WorkspaceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function WorkspaceCard({ workspaceID, isSelected, onSelectionChange }: TW
<Text
fontSize="sm"
color="gray.500"
userSelect="auto"
userSelect="text"
maxWidth="30rem"
overflow="hidden"
whiteSpace="nowrap"
Expand Down

0 comments on commit 3092dd6

Please sign in to comment.