Merge pull request #15567 from calixteman/bug1794717
[Editor] Change the caret cursor into the arrow one only when a text editor isn't empty (bug 1794717)
This commit is contained in:
		
						commit
						c6cc7c6e6a
					
				| @ -34,6 +34,8 @@ class FreeTextEditor extends AnnotationEditor { | ||||
| 
 | ||||
|   #boundEditorDivFocus = this.editorDivFocus.bind(this); | ||||
| 
 | ||||
|   #boundEditorDivInput = this.editorDivInput.bind(this); | ||||
| 
 | ||||
|   #boundEditorDivKeydown = this.editorDivKeydown.bind(this); | ||||
| 
 | ||||
|   #color; | ||||
| @ -230,7 +232,7 @@ class FreeTextEditor extends AnnotationEditor { | ||||
|     this.editorDiv.addEventListener("keydown", this.#boundEditorDivKeydown); | ||||
|     this.editorDiv.addEventListener("focus", this.#boundEditorDivFocus); | ||||
|     this.editorDiv.addEventListener("blur", this.#boundEditorDivBlur); | ||||
|     this.parent.div.classList.remove("freeTextEditing"); | ||||
|     this.editorDiv.addEventListener("input", this.#boundEditorDivInput); | ||||
|   } | ||||
| 
 | ||||
|   /** @inheritdoc */ | ||||
| @ -248,6 +250,7 @@ class FreeTextEditor extends AnnotationEditor { | ||||
|     this.editorDiv.removeEventListener("keydown", this.#boundEditorDivKeydown); | ||||
|     this.editorDiv.removeEventListener("focus", this.#boundEditorDivFocus); | ||||
|     this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur); | ||||
|     this.editorDiv.removeEventListener("input", this.#boundEditorDivInput); | ||||
| 
 | ||||
|     // On Chrome, the focus is given to <body> when contentEditable is set to
 | ||||
|     // false, hence we focus the div.
 | ||||
| @ -374,6 +377,10 @@ class FreeTextEditor extends AnnotationEditor { | ||||
|     this.isEditing = false; | ||||
|   } | ||||
| 
 | ||||
|   editorDivInput(event) { | ||||
|     this.parent.div.classList.toggle("freeTextEditing", this.isEmpty()); | ||||
|   } | ||||
| 
 | ||||
|   /** @inheritdoc */ | ||||
|   disableEditing() { | ||||
|     this.editorDiv.setAttribute("role", "comment"); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user