Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 6cee8e4

Browse files
committed
Allow type override for <Control.text> + unit tests. Fixes #814
1 parent 1e75090 commit 6cee8e4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/control-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ function createControlClass(s = defaultStrategy) {
715715
{...this.props}
716716
mapProps={{
717717
...controlPropsMap.text,
718-
type: 'text',
718+
type: this.props.type || 'text',
719719
...this.props.mapProps,
720720
}}
721721
/>

test/control-component-spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Object.keys(testContexts).forEach((testKey) => {
153153
const textFieldElements = [
154154
[''],
155155
['text'],
156+
['text', 'email'],
156157
['input', 'text'],
157158
['input', 'password'],
158159
['input', 'number'],
@@ -219,7 +220,7 @@ Object.keys(testContexts).forEach((testKey) => {
219220
'testing again');
220221
});
221222

222-
if (controlType === 'text') {
223+
if (controlType === 'text' && !type) {
223224
it('should have a type="text"', () => {
224225
assert.equal(node.getAttribute('type'), 'text');
225226
});

0 commit comments

Comments
 (0)