HTML: Enhances expand selection feature (#903)

Fixes #903.