This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ export default class InputTextView extends View {
3838 */
3939 this . set ( 'id' ) ;
4040
41+ /**
42+ * The `placeholder` attribute of the input.
43+ *
44+ * @observable
45+ * @member {String} #placeholder
46+ */
47+ this . set ( 'placeholder' ) ;
48+
4149 const bind = this . bindTemplate ;
4250
4351 this . template = new Template ( {
@@ -48,7 +56,8 @@ export default class InputTextView extends View {
4856 'ck-input' ,
4957 'ck-input-text'
5058 ] ,
51- id : bind . to ( 'id' )
59+ id : bind . to ( 'id' ) ,
60+ placeholder : bind . to ( 'placeholder' )
5261 }
5362 } ) ;
5463
Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ describe( 'InputTextView', () => {
5656 expect ( view . element . id ) . to . equal ( 'baz' ) ;
5757 } ) ;
5858 } ) ;
59+
60+ describe ( 'placeholder' , ( ) => {
61+ it ( 'should react on view#placeholder' , ( ) => {
62+ expect ( view . element . placeholder ) . to . equal ( '' ) ;
63+
64+ view . placeholder = 'baz' ;
65+
66+ expect ( view . element . placeholder ) . to . equal ( 'baz' ) ;
67+ } ) ;
68+ } ) ;
5969 } ) ;
6070
6171 describe ( 'select()' , ( ) => {
You can’t perform that action at this time.
0 commit comments