Skip to content

Commit

Permalink
fix(range): participate in <form> (#19008)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Aug 6, 2019
1 parent f94300c commit 8f7853c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/components/item/test/inputs/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test('item: inputs', async () => {

// check form
await page.click('#submit');
await checkFormResult(page, '{"date":"","select":"n64","toggle":"","input":"","input2":"","checkbox":""}');
await checkFormResult(page, '{"date":"","select":"n64","toggle":"","input":"","input2":"","checkbox":"","range":"10"}');
await page.waitFor(100);

// Default case, enabled and no value
Expand Down Expand Up @@ -36,7 +36,7 @@ test('item: inputs', async () => {

// check form
await page.click('#submit');
await checkFormResult(page, '{"date":"2016-12-09","select":"nes","toggle":"on","input":"Some text","input2":"Some text","checkbox":"on"}');
await checkFormResult(page, '{"date":"2016-12-09","select":"nes","toggle":"on","input":"Some text","input2":"Some text","checkbox":"on","range":"20"}');
await page.waitFor(100);

compare = await page.compareScreenshot('should reenable and set value');
Expand Down
4 changes: 3 additions & 1 deletion core/src/components/range/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop

import { getIonMode } from '../../global/ionic-global';
import { Color, Gesture, GestureDetail, KnobName, RangeChangeEventDetail, RangeValue, StyleEventDetail } from '../../interface';
import { clamp, debounceEvent } from '../../utils/helpers';
import { clamp, debounceEvent, renderHiddenInput } from '../../utils/helpers';
import { createColorClasses, hostContext } from '../../utils/theme';

/**
Expand Down Expand Up @@ -406,6 +406,8 @@ export class Range implements ComponentInterface {
}
}

renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);

return (
<Host
onFocusin={this.onFocus}
Expand Down

0 comments on commit 8f7853c

Please sign in to comment.