Created by: vicary
Patch remade from v4-dev.
v4-dev
Fixes #17927 (closed), see this plunker for a live demo.