Skip to content

Commit

Permalink
Fix #17
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Aug 6, 2021
1 parent fbfed7f commit 2159392
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/settingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export function createHeading(opts: {
.then((b) => {
b.extraSettingsEl.onClickEvent((e) => {
e.stopPropagation();
const title = opts.sectionName === opts.config.title ? opts.config.title : `${opts.sectionName} > ${opts.config.title}`;
const title =
opts.sectionName === opts.config.title
? opts.config.title
: `${opts.sectionName} > ${opts.config.title}`;
opts.settingsManager.export(
title,
opts.settingsManager.getSettings(opts.sectionId, opts.children)
Expand Down Expand Up @@ -468,6 +471,13 @@ export function createVariableColor(opts: {
instance.hide();
instance.addSwatch(color.toHEXA().toString());
})
.on("show", () => {
const { result } = (pickr.getRoot() as any).interaction;

requestAnimationFrame(() =>
requestAnimationFrame(() => result.select())
);
})
.on("cancel", onPickrCancel);
})
.addExtraButton((b) => {
Expand Down Expand Up @@ -596,6 +606,13 @@ export function createVariableThemedColor(opts: {
: config["default-light"],
})
)
.on("show", () => {
const { result } = (pickrLight.getRoot() as any).interaction;

requestAnimationFrame(() =>
requestAnimationFrame(() => result.select())
);
})
.on("save", onSave(idLight))
.on("cancel", onPickrCancel);

Expand All @@ -622,6 +639,13 @@ export function createVariableThemedColor(opts: {
: config["default-dark"],
})
)
.on("show", () => {
const { result } = (pickrDark.getRoot() as any).interaction;

requestAnimationFrame(() =>
requestAnimationFrame(() => result.select())
);
})
.on("save", onSave(idDark))
.on("cancel", onPickrCancel);

Expand Down

0 comments on commit 2159392

Please sign in to comment.