Skip to content

Commit 201536a

Browse files
fix: render when clearing.
1 parent 56fae3e commit 201536a

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

playwright/app.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ test('clearing component source reports clear action without error status', asyn
347347
await expect(page.locator('#status')).toHaveText('Component cleared')
348348
await expect(page.locator('#status')).toHaveClass(/status--neutral/)
349349
await expect(page.locator('#preview-host pre')).toHaveCount(0)
350+
await expect(page.locator('#preview-host button')).toHaveCount(0)
350351
})
351352

352353
test('jsx syntax errors affect status but not diagnostics toggle severity', async ({

src/app.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,19 +472,14 @@ const clearComponentSource = () => {
472472
clearDiagnosticsScope('component')
473473
typeDiagnostics.clearTypeDiagnosticsState()
474474
setStatus('Component cleared', 'neutral')
475-
476-
if (!jsxCodeEditor) {
477-
maybeRender()
478-
}
475+
maybeRender()
479476
}
480477

481478
const clearStylesSource = () => {
482479
setCssSource('')
483480
clearDiagnosticsScope('styles')
484481
setStatus('Styles cleared', 'neutral')
485-
if (!cssCodeEditor) {
486-
maybeRender()
487-
}
482+
maybeRender()
488483
}
489484

490485
const confirmClearSource = ({ label, onConfirm }) => {

0 commit comments

Comments
 (0)