Fix issue #827 with enter-in-input sometimes focusing to non-applicable button