Fixed Nestable not coercing value

digitalpoint

Well-known member
Affected version
2.3.3
Ran into an issue where XF.Nestable wasn't working as expected if items went to different roots. Did some tracing and the target nestable isn't triggering the change event.

More tracing it and turns out the issue is that this will never work (in nestable.js):
JavaScript:
if (isNewRoot && opt.group !== pointElRoot.dataset.nestableGroup)

...because typeof(opt.group) is always number and typeof(pointElRoot.dataset.nestableGroup) is always string.

Changing it to this and things started working as expected:
JavaScript:
if (isNewRoot && opt.group != pointElRoot.dataset.nestableGroup)
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.4).

Change log:
Coerce nestable group to a number before peforming strict comparison
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom