Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Wrap input/textarea in label in textbox component, id and name is not…
Browse files Browse the repository at this point in the history
… requried
  • Loading branch information
romanslonov committed Apr 16, 2019
1 parent f2f72d1 commit 89629f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/components/textbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Textbox is a universal component that can turn into both input and textarea.
## Props
Name | Type | Description | Default | Required
---- | :----: | ------------- | ------- | --------
id | [String, Number] | Unique identifier | - | true
id | [String, Number] | Unique identifier | - | false
name | String | Input name | - | false
value, v-model| [String, Number] | The model that the textbox value syncs to. Can be set initially as a default value. |`''` | false
type | String | Supported values are `text`, `password`, `search`, `email`, `url`, `tel`, and `number`. Only applicable when `multiLine` is `false` | `text` | false
Expand Down
8 changes: 3 additions & 5 deletions src/components/Textbox/main.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="textbox">
<label :for="id" class="textbox__label">{{ label }}</label>
<label class="textbox">
<div class="textbox__label">{{ label }}</div>

<input
v-if="!multiline"
Expand Down Expand Up @@ -58,7 +58,7 @@
class="textbox__textarea"
></textarea>

</div>
</label>
</template>

<script>
Expand All @@ -72,11 +72,9 @@ export default {
props: {
id: {
type: [String, Number],
required: true,
},
name: {
type: String,
required: true,
},
label: {
type: String,
Expand Down

0 comments on commit 89629f9

Please sign in to comment.