Use different events to trigger wysiwyg expansion.

From #4939.