History

fix api docs Window.prompt() example

example did not work as expected

SilverfishVR committed 3 years ago

Commit ec25cfd1 parent e17c9c41 file · +2 −2Browse files

Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 1 file). Show all

Unified · Split

interface/src/scripting/WindowScriptingInterface.h+2−2
@@ -112,10 +112,10 @@ public slots: · 111 unmodified lines
112112 * @function Window.prompt
113113 * @param {string} message - The question to display.
114114 * @param {string} defaultText - The default answer text.
115− * @returns {string} The text that the user entered if they select "OK", otherwise "".
115+ * @returns {string} The text that the user entered if they select "OK", otherwise null.
116116 * @example <caption>Ask the user a question requiring a text answer.</caption>
117117 * var answer = Window.prompt("Question", "answer");
118− * if (answer === "") {
118+ * if (answer === null) {
119119 * print("User canceled");
120120 * } else {
121121 * print("User answer: " + answer);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t