Skip to content

Commit

Permalink
fix(forms): use KTextArea in array fields (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumimakito authored Jun 20, 2024
1 parent af256d3 commit 0c3d23b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/core/forms/src/generator/FormGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export default {
width: 100%;
}
:not(.k-input).form-control {
:not(.k-input):not(.k-textarea).form-control {
background-color: #fff;
background-image: none;
border: none;
Expand Down
29 changes: 17 additions & 12 deletions packages/core/forms/src/generator/fields/advanced/FieldArray.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@
:schema="generateSchema(value, schema.items, index)"
@remove-item="removeElement(index)"
>
<FieldTextArea
<KTextArea
v-if="schema.inputAttributes && schema.inputAttributes.type === 'textarea'"
v-bind="schema.inputAttributes"
:id="getFieldID(schema)"
v-model="value[index]"
:aria-labelledby="getLabelId(schema)"
class="k-input"
:form-options="formOptions"
:model="item"
:schema="generateSchema(value, schema.items, index)"
@model-updated="modelUpdated"
:class="schema.fieldClasses"
:maxlength="schema.max"
:minlength="schema.min"
:name="schema.inputName"
:placeholder="schema.placeholder"
:readonly="schema.readonly"
:required="schema.required"
:rows="schema.rows || 2"
/>

<KInput
Expand Down Expand Up @@ -90,6 +96,7 @@
@click="removeElement(index)"
>
</div>
<KButton
appearance="tertiary"
:class="schema.newElementButtonLabelClasses"
Expand All @@ -104,17 +111,16 @@
<script>
import abstractField from '../abstractField'
import FieldInput from '../core/FieldInput.vue'
import FieldSelect from '../core/fieldSelect.vue'
import FieldArrayCardContainer from './FieldArrayCardContainer.vue'
import FieldArrayItem from './FieldArrayItem.vue'
import FieldArrayMultiItem from './FieldArrayMultiItem.vue'
import FieldAutoSuggest from './FieldAutoSuggest.vue'
import FieldMetric from './FieldMetric.vue'
import FieldObject from './FieldObject.vue'
import FieldObjectAdvanced from './FieldObjectAdvanced.vue'
import FieldAutoSuggest from './FieldAutoSuggest.vue'
import FieldArrayCardContainer from './FieldArrayCardContainer.vue'
import FieldRadio from './FieldRadio.vue'
import FieldInput from '../core/FieldInput.vue'
import FieldSelect from '../core/fieldSelect.vue'
import FieldTextArea from '../core/fieldTextArea.vue'
export default {
name: 'FieldArray',
Expand All @@ -128,7 +134,6 @@ export default {
FieldAutoSuggest,
FieldRadio,
FieldArrayCardContainer,
FieldTextArea,
FieldInput,
},
mixins: [abstractField],
Expand Down

0 comments on commit 0c3d23b

Please sign in to comment.