Commit 8790442
Fix typing into a slot in the browser demo
Clicking a white oval opened the little input box and handed it the keyboard,
and then the browser carried on with what a click normally does and moved the
focus somewhere else. The blur listener took that as "finished editing" and
shut the box again, so nothing could ever be typed. Calling preventDefault on
the pointerdown that opens an editor or a menu stops the focus being taken
away.
Synthetic events never run a browser's default actions, which is exactly why
the earlier tests were happy: they proved the editor opened, focused and
committed, and none of that was the part that was broken.
Two more things found while chasing it:
- the box was placed using screen coordinates, so it landed in the wrong
place as soon as the workspace was scrolled. The canvas is the only thing
in the stage's flow, so its top left is the origin an absolutely positioned
box is measured from, and slot coordinates can be used as they are.
- clicking a value inside a drawer block did nothing at all. It now drags the
block out, the way clicking anywhere else on it does.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent dfe86a9 commit 8790442
1 file changed
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2967 | 2967 | | |
2968 | 2968 | | |
2969 | 2969 | | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | 2970 | | |
2974 | | - | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
2975 | 2990 | | |
2976 | 2991 | | |
2977 | 2992 | | |
| |||
3143 | 3158 | | |
3144 | 3159 | | |
3145 | 3160 | | |
3146 | | - | |
3147 | | - | |
3148 | 3161 | | |
3149 | 3162 | | |
3150 | 3163 | | |
3151 | | - | |
3152 | | - | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
3153 | 3170 | | |
3154 | 3171 | | |
3155 | 3172 | | |
| |||
0 commit comments