fix: avoid declaration tag warning in event handlers (#18500)