Enter key support

pull/6798/head
Cagatay Civici 2024-11-13 13:00:37 +03:00
parent 6695e7a564
commit 0572139f0f
1 changed files with 23 additions and 9 deletions

View File

@ -36,8 +36,10 @@
</TabPanel> </TabPanel>
<TabPanel value="1"> <TabPanel value="1">
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
<DesignBorderRadius /> <form @keydown="onKeyDown">
<DesignColors /> <DesignBorderRadius />
<DesignColors />
</form>
</div> </div>
</TabPanel> </TabPanel>
<TabPanel value="2"> <TabPanel value="2">
@ -46,11 +48,13 @@
<AccordionHeader>Common</AccordionHeader> <AccordionHeader>Common</AccordionHeader>
<AccordionContent> <AccordionContent>
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
<DesignGeneral /> <form @keydown="onKeyDown">
<DesignFormField /> <DesignGeneral />
<DesignList /> <DesignFormField />
<DesignNavigation /> <DesignList />
<DesignOverlay /> <DesignNavigation />
<DesignOverlay />
</form>
</div> </div>
</AccordionContent> </AccordionContent>
</AccordionPanel> </AccordionPanel>
@ -65,10 +69,14 @@
</TabList> </TabList>
<TabPanels class="!px-0"> <TabPanels class="!px-0">
<TabPanel value="cs-0"> <TabPanel value="cs-0">
<DesignCS :value="preset.semantic.colorScheme.light" /> <form @keydown="onKeyDown">
<DesignCS :value="preset.semantic.colorScheme.light" />
</form>
</TabPanel> </TabPanel>
<TabPanel value="cs-1"> <TabPanel value="cs-1">
<DesignCS :value="preset.semantic.colorScheme.dark" /> <form @keydown="onKeyDown">
<DesignCS :value="preset.semantic.colorScheme.dark" />
</form>
</TabPanel> </TabPanel>
</TabPanels> </TabPanels>
</Tabs> </Tabs>
@ -335,6 +343,12 @@ app.mount("#app");
refreshACTokens() { refreshACTokens() {
this.acTokens = []; this.acTokens = [];
this.generateACTokens(null, this.preset); this.generateACTokens(null, this.preset);
},
onKeyDown(event) {
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
this.apply();
event.preventDefault();
}
} }
} }
}; };