Skip to content

Commit

Permalink
fix: editor losing focus after selecting a color with the color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed May 20, 2022
1 parent ea52484 commit 8cb912a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/lib/plugins/value/components/ColorPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import { compileJSONPointer } from 'immutable-json-patch'
import { getContext } from 'svelte'
import ColorPickerPopup from '../../../components/controls/ColorPickerPopup.svelte'
import { SELECTION_TYPE } from '../../../logic/selection.js'
const { openAbsolutePopup } = getContext('absolute-popup')
export let path
export let value
export let readOnly
export let onPatch
export let onSelect
$: color = getColorCSS(value)
Expand All @@ -24,6 +26,8 @@
value: color
}
])
onSelect({ type: SELECTION_TYPE.VALUE, path })
}
function openColorPicker(event) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/plugins/value/renderValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function renderValue({
if (!isEditing && isColor(value)) {
renderers.push({
component: ColorPicker,
props: { path, value, readOnly, onPatch }
props: { path, value, readOnly, onPatch, onSelect }
})
}

Expand Down

0 comments on commit 8cb912a

Please sign in to comment.