Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Select correct Superkey/Macro in Layout Editor #907

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/renderer/modules/KeysTabs/MacroTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const MacroTab = (props: MacroTabProps) => {
return macrosContainer;
});

const currentlySelectedMacroIndex = macros.length > 0 && props.keyCode.modified === 53852 ? String(props.keyCode.base) : undefined;
return (
<div
className={`flex flex-wrap h-[inherit] ${isStandardView ? "standardViewTab" : ""} tabsMacro ${disabled ? "opacity-50 pointer-events-none" : ""}`}
Expand Down Expand Up @@ -90,11 +91,7 @@ const MacroTab = (props: MacroTabProps) => {
{i18n.editor.macros.macroTab.label}
</Heading>
<Select
// value={
// macrosAux.length > 0 && macrosAux[selected] !== undefined && macrosAux[selected].text
// ? macrosAux[selected].value
// : "Loading"
// }
value={currentlySelectedMacroIndex}
onValueChange={isStandardView ? changeSelectedStd : changeSelected}
>
<SelectTrigger className="w-[280px]">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/modules/KeysTabs/SuperkeysTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const SuperkeysTab = ({ macros, keyCode, isStandardView, actions, onKeySelect, s
{i18n.editor.standardView.superkeys.label}
</Heading>
<div className="superKeySelect">
<Select onValueChange={value => onKeySelect(parseInt(value, 10))}>
<Select onValueChange={value => onKeySelect(parseInt(value, 10))} value={superk.indexOf(KC) >= 0 ? String(KC) : undefined}>
<SelectTrigger className="w-[280px]">
<SelectValue placeholder="Select Superkey" />
</SelectTrigger>
Expand Down
Loading