Skip to content

Commit

Permalink
Merge pull request #10218 from filamentphp/fix/lazy-color-picker
Browse files Browse the repository at this point in the history
fix: lazy color picker
  • Loading branch information
danharrin authored Dec 9, 2023
2 parents 69ff129 + 98a8c9d commit 08c7378
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/forms/dist/components/color-picker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/forms/resources/js/components/color-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'vanilla-colorful/rgba-string-color-picker.js'
export default function colorPickerFormComponent({
isAutofocused,
isDisabled,
isLiveOnPickerClose,
isLiveDebounced,
isLiveOnBlur,
state,
}) {
return {
Expand All @@ -29,7 +30,7 @@ export default function colorPickerFormComponent({
this.setState(event.detail.value)
})

if (isLiveOnPickerClose) {
if (isLiveDebounced || isLiveOnBlur) {
new MutationObserver(() => {
if (this.$refs.panel.style.display !== 'none') {
return
Expand Down
Loading

0 comments on commit 08c7378

Please sign in to comment.