Fixes #17217.  Forward port [2876164aa20aff71392d37d3d492e30d4618c6b3/dijit] to trunk.