Skip to content

Commit

Permalink
Add support for min & max on HTML 5 inputs
Browse files Browse the repository at this point in the history
This will allow support of the min & max attributes on the `number` and
`range` input types from HTML5.
  • Loading branch information
bcardarella committed Dec 9, 2013
1 parent 83f6f8d commit 8eb4e53
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions packages/ember-handlebars/lib/controls/text_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Ember.TextField = Ember.Component.extend(Ember.TextSupport,

classNames: ['ember-text-field'],
tagName: "input",
attributeBindings: ['type', 'value', 'size', 'pattern', 'name'],
attributeBindings: ['type', 'value', 'size', 'pattern', 'name', 'min', 'max'],

/**
The `value` attribute of the input element. As the user inputs text, this
Expand Down Expand Up @@ -63,11 +63,29 @@ Ember.TextField = Ember.Component.extend(Ember.TextSupport,
size: null,

/**
The `pattern` the pattern attribute of input element.
The `pattern` attribute of input element.
@property pattern
@type String
@default null
*/
pattern: null
pattern: null,

/**
The `min` attribute of input element used with `type="number"` or `type="range"`.
@property min
@type String
@default null
*/
min: null,

/**
The `max` attribute of input element used with `type="number"` or `type="range"`.
@property max
@type String
@default null
*/
max: null
});

0 comments on commit 8eb4e53

Please sign in to comment.