Fix enter key loop in sweep commands (#7112)
* use effect for focus of command palette submit button, not autoFocus autoFocus is being overridden by the Headless UI Dialog component's focus management here https://headlessui.com/v1/react/dialog#focus-management (we do not have access to pass back initialFocus in this case). So we can use an effect to imperatively focus the button when this component is mounted. * Update sweep tests to submit the command with Enter
This commit is contained in:
@ -1855,7 +1855,11 @@ sketch002 = startSketchOn(XZ)
|
||||
},
|
||||
stage: 'review',
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
// Confirm we can submit from the review step with just `Enter`
|
||||
await cmdBar.progressCmdBar(true)
|
||||
await cmdBar.expectState({
|
||||
stage: 'commandBarClosed',
|
||||
})
|
||||
})
|
||||
|
||||
await test.step(`Confirm code is added to the editor, scene has changed`, async () => {
|
||||
@ -1995,7 +1999,7 @@ profile001 = ${circleCode}`
|
||||
},
|
||||
stage: 'review',
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.progressCmdBar(true)
|
||||
await editor.expectEditor.toContain(sweepDeclaration)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user