Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
fix: fixed radio button issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKienle committed Jul 30, 2019
1 parent ce71c60 commit 74e1215
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions src/components/Form/Controls/InputMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ export default {
plain: $default(false)
},
computed: {
inputStateClasses() {
const { state } = this;
return { [`is-${state}`]: state != null };
},
inputClasses() {
return {
"fd-form__control": !this.plain,
"fd-input--compact": this.finalCompact,
...this.inputStateClasses,
"is-required": this.required
"is-required": this.required,
"is-valid": this.state === "valid",
"is-invalid": this.state === "invalid",
"is-warning": this.state === "warning"
};
},
inputId() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/Controls/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
:disabled="disabled ? '' : null"
:checked="checked ? true : false"
:value="value"
@input="$emit('update', $event.target.value, $event)"
@change="$emit('update', $event.target.value, $event)"
v-on="$listeners"
v-bind="$attrs"
:id="inputId"
/>
</template>

<script>
// :id="inputId"
import InputMixin from "./InputMixin";
import { $valueWithDefault, $modelValueWithDefault } from "./Helper/prop";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/Controls/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
@change="$emit('update', $event.target.value)"
v-on="$listeners"
v-bind="$attrs"
:id="inputId"
>
<slot />
</select>
</template>

<script>
// :id="inputId"
import InputMixin from "./InputMixin";
import { $valueWithDefault } from "./Helper/prop";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/Controls/Toggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:value="value"
:disabled="disabled"
@update="$emit('update', $event)"
></FdCheckbox>
/>
<span class="fd-toggle__switch" role="presentation" />
</span>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/Controls/__tests__/Checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("FormItem", () => {
expect(radio.isVisible()).toBe(true);

radio.element.value = "helloWorld";
radio.trigger("input");
radio.trigger("change");
await localVue.nextTick();
expect(form.vm.checked).toBe("helloWorld");
});
Expand Down

0 comments on commit 74e1215

Please sign in to comment.