mirror of
https://github.com/enso-org/enso.git
synced 2024-12-28 11:25:30 +03:00
Ignore repeated key events for bound shortcuts, adjust visualization min width (#9537)
Fixes #8538 #9515 All repeated keyboard events handled through `defineShortcuts` are now ignored. For example, holding ctrl+v no longer pastes nodes repeatedly. Also adjusted visualization min-width to 200px, since it was a trivial change. ![image](https://github.com/enso-org/enso/assets/919491/7997898f-bcee-45f2-aacb-e10a49b159d6)
This commit is contained in:
parent
70f847f295
commit
1872bb66ea
@ -15,10 +15,10 @@ const props = defineProps<{
|
||||
belowToolbar?: boolean
|
||||
}>()
|
||||
|
||||
/** The total width of:
|
||||
/** The minimum width must be at least the total width of:
|
||||
* - both of toolbars that are always visible (32px + 60px), and
|
||||
* - the 4px flex gap between the toolbars. */
|
||||
const MIN_WIDTH_PX = 96
|
||||
const MIN_WIDTH_PX = 200
|
||||
|
||||
const config = useVisualizationConfig()
|
||||
|
||||
@ -194,7 +194,7 @@ const resizeBottomRight = usePointer((pos, _, type) => {
|
||||
<style scoped>
|
||||
.VisualizationContainer {
|
||||
--node-height: 32px;
|
||||
--permanent-toolbar-width: 96px;
|
||||
--permanent-toolbar-width: 200px;
|
||||
color: var(--color-text);
|
||||
background: var(--color-visualization-bg);
|
||||
position: absolute;
|
||||
|
@ -391,6 +391,9 @@ export function defineKeybinds<
|
||||
>,
|
||||
): (event: Event_, stopAndPrevent?: boolean) => boolean {
|
||||
return (event, stopAndPrevent = true) => {
|
||||
// Do not handle repeated keyboard events (held down key).
|
||||
if (event instanceof KeyboardEvent && event.repeat) return false
|
||||
|
||||
const eventModifierFlags = modifierFlagsForEvent(event)
|
||||
const keybinds =
|
||||
event instanceof KeyboardEvent ?
|
||||
|
Loading…
Reference in New Issue
Block a user