ItsJonQ / g2

✨ An experimental reimagining of WordPress components
http://g2-components.com/
MIT License
105 stars 12 forks source link

SelectDropdown: Fix duplicate onChange callback #206

Closed ItsJonQ closed 3 years ago

ItsJonQ commented 3 years ago

This update fixes the unexpected duplicate onChange callback for the SelectDropdown component. The solution was to add a guard for the onChange sync hook. This guard ensures that the onChange based on value changes only happens for isPreviewable mode.

Resolves: https://github.com/ItsJonQ/g2/issues/202

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/itsjonq/g2/dllwi2353
✅ Preview: https://g2-git-fix-select-dropdown-onchange-callback-dupe.itsjonq.vercel.app