Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit df1e12f

Browse files
author
Yvonne Yip
committed
Merge pull request #14 from dominiklessel/master
Added: blur, click, focus, select, setSelectionRange, setRangeText, stepDown, stepUp method forwarders
2 parents 2149202 + 0866136 commit df1e12f

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

core-input.html

+46
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,52 @@
316316
inputBlurAction: function() {
317317
// re-fire non-bubbling event
318318
this.fire('blur', null, this, false);
319+
},
320+
321+
blur: function() {
322+
// forward blur method to the internal input / textarea element
323+
this.$.input.blur();
324+
},
325+
326+
click: function() {
327+
// forward click method to the internal input / textarea element
328+
this.$.input.click();
329+
},
330+
331+
focus: function() {
332+
// forward focus method to the internal input / textarea element
333+
this.$.input.focus();
334+
},
335+
336+
select: function() {
337+
// forward select method to the internal input / textarea element
338+
this.$.input.focus();
339+
},
340+
341+
setSelectionRange: function( selectionStart, selectionEnd, selectionDirection ) {
342+
// forward setSelectionRange method to the internal input / textarea element
343+
this.$.input.setSelectionRange( selectionStart, selectionEnd, selectionDirection );
344+
},
345+
346+
setRangeText: function( replacement, start, end, selectMode ) {
347+
// forward setRangeText method to the internal input element
348+
if ( !this.multiline ) {
349+
this.$.input.setRangeText( replacement, start, end, selectMode );
350+
}
351+
},
352+
353+
stepDown: function( n ) {
354+
// forward stepDown method to the internal input element
355+
if ( !this.multiline ) {
356+
this.$.input.stepDown( n );
357+
}
358+
},
359+
360+
stepUp: function( n ) {
361+
// forward stepUp method to the internal input element
362+
if ( !this.multiline ) {
363+
this.$.input.stepUp( n );
364+
}
319365
}
320366

321367
});

0 commit comments

Comments
 (0)