Skip to content

Commit

Permalink
feat(input-textarea): add rows="fill" option (#208) (#216)
Browse files Browse the repository at this point in the history
close #208

Co-authored-by: Kia Ishii <kia.king.08@gmail.com>
  • Loading branch information
brc-dd and kiaking committed Feb 1, 2023
1 parent 66b89a0 commit 7054764
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/components/SInputTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const props = defineProps<{
checkColor?: Color
placeholder?: string
disabled?: boolean
rows?: number
rows?: number | 'fill'
modelValue: string | null
hideError?: boolean
validation?: Validatable
Expand All @@ -31,7 +31,8 @@ const emit = defineEmits<{
const classes = computed(() => [
props.size ?? 'small',
{ disabled: props.disabled }
{ disabled: props.disabled },
{ fill: props.rows === 'fill' }
])
function emitInput(e: Event): void {
Expand Down Expand Up @@ -62,6 +63,7 @@ function emitBlur(e: FocusEvent): void {
<textarea
:id="name"
class="input"
:class="{ fill: rows === 'fill' }"
:placeholder="placeholder"
:rows="rows ?? 3"
:disabled="disabled"
Expand All @@ -73,7 +75,7 @@ function emitBlur(e: FocusEvent): void {
</SInputBase>
</template>
<style lang="postcss" scoped>
<style scoped lang="postcss">
.SInputTextarea.mini {
.input {
padding: 6px 12px;
Expand Down Expand Up @@ -155,5 +157,9 @@ function emitBlur(e: FocusEvent): void {
.dark &:hover:focus {
border-color: var(--c-info);
}
&.fill {
height: 100%;
}
}
</style>

0 comments on commit 7054764

Please sign in to comment.