mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	fix prompt mutability (autocomplete on answer input field)
This commit is contained in:
		| @@ -1,6 +1,9 @@ | ||||
| const $dialog = $("#prompt-dialog"); | ||||
| const $question = $("#prompt-dialog-question"); | ||||
| const $answer = $("#prompt-dialog-answer"); | ||||
| const $dialogBody = $dialog.find(".modal-body"); | ||||
|  | ||||
| let $question; | ||||
| let $answer; | ||||
|  | ||||
| const $form = $("#prompt-dialog-form"); | ||||
|  | ||||
| let resolve; | ||||
| @@ -11,8 +14,21 @@ function ask({ message, defaultValue, shown }) { | ||||
|  | ||||
|     shownCb = shown; | ||||
|  | ||||
|     $question.text(message); | ||||
|     $answer.val(defaultValue || ""); | ||||
|     $question = $("<label>") | ||||
|         .prop("for", "prompt-dialog-answer") | ||||
|         .text(message); | ||||
|  | ||||
|     $answer = $("<input>") | ||||
|         .prop("type", "text") | ||||
|         .prop("id", "prompt-dialog-answer") | ||||
|         .addClass("form-control") | ||||
|         .val(defaultValue || ""); | ||||
|  | ||||
|     $dialogBody.empty().append( | ||||
|         $("<div>") | ||||
|             .addClass("form-group") | ||||
|             .append($question) | ||||
|             .append($answer)); | ||||
|  | ||||
|     $dialog.modal(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user