Skip to content

Commit

Permalink
set default type of Input components to 'text'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Apr 30, 2019
1 parent 4153430 commit 53f9d25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Input.react.js
Expand Up @@ -100,6 +100,7 @@ export default class Input extends Component {
}

Input.defaultProps = {
type: 'text',
n_blur: 0,
n_blur_timestamp: -1,
n_submit: 0,
Expand Down
9 changes: 7 additions & 2 deletions test/test_integration.py
Expand Up @@ -842,8 +842,7 @@ def test_gallery(self):
),

html.Label('Text Input'),
dcc.Input(value='', placeholder='type here', type='text',
id='textinput'),
dcc.Input(value='', placeholder='type here', id='textinput'),
html.Label('Disabled Text Input'),
dcc.Input(value='disabled', type='text',
id='disabled-textinput', disabled=True),
Expand Down Expand Up @@ -968,6 +967,12 @@ def test_gallery(self):
self.snapshot('gallery - chinese character')

text_input = self.driver.find_element_by_id('textinput')
# verify that type has the right default
# Can't use text_input.get_attribute('type') - that pulls the
# default value even if none is specified.
get_type = ('return document.getElementById("textinput")'
'.getAttribute("type");')
self.assertEqual(self.driver.execute_script(get_type), 'text')
disabled_text_input = self.driver.find_element_by_id(
'disabled-textinput')
text_input.send_keys('HODOR')
Expand Down

0 comments on commit 53f9d25

Please sign in to comment.