Fix inconsistency between demo and displayed code for modal demo

Fixes #13991
Merge pull request #13992 from pjrobertson/master

Fix inconsistency between demo and displayed code for modal demo