Build: fix slider and rangeslider dependencies from bad cherry-pick

Fixes gh-7461
Closes gh-7462