Send cancel event from toolbar 'sketch no face' state to enable ESC (#2592)

* Just cancel out of 'sketch no face' state

* add test

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* trigger ci

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Dan Shaw
2024-07-04 15:53:58 -07:00
committed by GitHub
parent 33b15e818b
commit fbc2e9d02c
6 changed files with 27 additions and 2 deletions

View File

@ -81,7 +81,7 @@ export function Toolbar({
useHotkeys(
'esc',
() =>
state.matches('Sketch.SketchIdle')
['Sketch no face', 'Sketch.SketchIdle'].some(state.matches)
? send('Cancel')
: send('CancelSketch'),
{ enabled: !disableAllButtons, scopes: ['sketch'] }
@ -226,7 +226,7 @@ export function Toolbar({
)}
{state.matches('Sketch no face') && (
<li className="contents">
<div className="mx-2 text-sm">click plane to sketch on</div>
<div className="mx-2 text-sm">click plane or face to sketch on</div>
</li>
)}
{state.matches('Sketch') && !state.matches('idle') && (