mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-11 16:18:10 +00:00
Merge pull request #406 from thewhodidthis/bf#404--textbox
visual/TextBox: add clear method, tweak reset to take editable into account
This commit is contained in:
commit
9cecf2984f
@ -178,17 +178,33 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
|
||||
|
||||
|
||||
/**
|
||||
* Clears the current text value.
|
||||
* Clears the current text value or sets it back to match the placeholder.
|
||||
*
|
||||
* @name module:visual.TextBox#reset
|
||||
* @public
|
||||
*/
|
||||
reset()
|
||||
{
|
||||
const text = this.editable ? '' : this.placeholder;
|
||||
|
||||
this.setText(this.placeholder);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Clears the current text value.
|
||||
*
|
||||
* @name module:visual.TextBox#clear
|
||||
* @public
|
||||
*/
|
||||
clear()
|
||||
{
|
||||
this.setText();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* For tweaking the underlying input value.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user