@salesforcedevs/docs-components
Advanced tools
Comparing version
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "0.0.8-edit", | ||
"version": "0.0.9-edit", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -109,2 +109,5 @@ import { LightningElement, api, track } from "lwc"; | ||
this.errorMessage = ""; | ||
// Set textarea value directly using ref | ||
this.updateTextareaValue(); | ||
} else { | ||
@@ -209,2 +212,13 @@ this.errorMessage = data.error || data.message || "Failed to load file content"; | ||
// Update textarea value using ref | ||
private updateTextareaValue() { | ||
// Use setTimeout to ensure DOM is updated | ||
setTimeout(() => { | ||
const textarea = this.template.querySelector('#file-content') as HTMLTextAreaElement; | ||
if (textarea && this.fileContent !== undefined) { | ||
textarea.value = this.fileContent; | ||
} | ||
}, 0); | ||
} | ||
connectedCallback() { | ||
@@ -215,2 +229,9 @@ // Add escape key listener | ||
renderedCallback() { | ||
// Ensure textarea value is set correctly when component renders | ||
if (this.isPopoverOpen && this.fileContent && !this.isLoading) { | ||
this.updateTextareaValue(); | ||
} | ||
} | ||
disconnectedCallback() { | ||
@@ -217,0 +238,0 @@ // Remove escape key listener |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
354897
0.2%8823
0.2%0
-100%