Skip to content

Commit

Permalink
fix: error not assignable to type 'StyleValue' in UiTextarea (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
pspaczek authored May 27, 2024
1 parent 2041f86 commit 8251bc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"vitest": "^0.34.1",
"vue-docgen-api": "^4.75.0",
"vue-loader": "^17.0.0",
"vue-tsc": "^1.8.22"
"vue-tsc": "^2.0.19"
},
"engines": {
"node": ">=16.13.2",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/components/atoms/UiTextarea/UiTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export interface TextareaEmits {
(e:'update:modelValue', value: TextareaModelValue): void
}
export interface Size {
width: string | null;
height: string | null;
minHeight: string | null;
width: string;
height: string;
minHeight: string;
}

const props = withDefaults(defineProps<TextareaProps>(), {
Expand Down Expand Up @@ -119,9 +119,9 @@ const resizeValue = computed(() => {
});
const textarea = ref<HTMLTextAreaElement | null>(null);
const textareaSize:Size = reactive({
width: null,
height: null,
minHeight: null,
width: '',
height: '',
minHeight: '',
});

const textareaMargin = '2px';
Expand All @@ -134,7 +134,7 @@ const setTextareaSize = (mutationList: MutationRecord[]) => {

const calcHeightPx = Number(height.replace('px', ''));
const calcMinHeightPx = Number(minHeight.replace('px', '')) + (2 * Number(textareaMargin.replace('px', '')));
const calcHeight = calcHeightPx > calcMinHeightPx ? null : `${calcMinHeightPx}px`;
const calcHeight = calcHeightPx > calcMinHeightPx ? '' : `${calcMinHeightPx}px`;

textareaSize.width = width;
textareaSize.height = calcHeight;
Expand Down

0 comments on commit 8251bc3

Please sign in to comment.