Skip to content

Commit

Permalink
try: build outputs should be read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 30, 2024
1 parent 480c97c commit e93513e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/try/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ function addBlock(isEntryPoint = false, path = '', content = ''): Block {
}
let sourceMapLinkEl: HTMLAnchorElement | undefined

disableAnnoyingBehaviors(pathEl)
disableAnnoyingBehaviors(contentEl)
disableAnnoyingBehaviors(pathEl, false)
disableAnnoyingBehaviors(contentEl, false)
pathEl.placeholder = '<stdin>'
pathEl.value = path
entryEl.className = 'entryToggle'
Expand Down
4 changes: 2 additions & 2 deletions src/try/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function resetHeight(el: HTMLTextAreaElement): void {
document.body.style.paddingBottom = '0'
}

export function disableAnnoyingBehaviors(el: HTMLTextAreaElement | HTMLInputElement, readOnly = false): void {
export function disableAnnoyingBehaviors(el: HTMLTextAreaElement | HTMLInputElement, readOnly: boolean): void {
el.readOnly = readOnly
el.spellcheck = false
el.autocapitalize = 'off'
Expand Down Expand Up @@ -194,7 +194,7 @@ export function updateBuildOutput({ outputFiles_, metafile_, mangleCache_, stder
outputPath.append(outputSize)
textarea.readOnly = true
textarea.value = file.text.replace(/\n$/, '')
disableAnnoyingBehaviors(textarea)
disableAnnoyingBehaviors(textarea, true)
div.className = 'buildOutput hasLabel'
div.append(textarea)

Expand Down

0 comments on commit e93513e

Please sign in to comment.