Page MenuHomePhabricator

getValueFix.diff

Authored By
bzimport
Nov 22 2014, 3:43 AM
Size
649 B
Referenced Files
None
Subscribers
None

getValueFix.diff

diff --git a/lib/oojs-ui/oojs-ui.js b/lib/oojs-ui/oojs-ui.js
index f9b608f..dedf40b 100644
--- a/lib/oojs-ui/oojs-ui.js
+++ b/lib/oojs-ui/oojs-ui.js
@@ -8580,6 +8580,19 @@ OO.ui.TextInputWidget.prototype.getInputElement = function ( config ) {
return config.multiline ? this.$( '<textarea>' ) : this.$( '<input type="text" />' );
};
+/**
+ * Get the value of the input.
+ *
+ * @return {string} Input value
+ */
+OO.ui.TextInputWidget.prototype.getValue = function () {
+ // validate the input is up to date
+ if ( this.value !== this.$input.val() ) {
+ this.setValue( this.$input.val() );
+ }
+ return this.value;
+};
+
/* Methods */
/**

Event Timeline