I think we should eventually make this a part of Widget: this functionality would be pretty useful for all types of widgets. Also, it its current shape here, it's unnecessarily generic, because `elementToFocus` is guaranteed to be non-null. However, for now let's just land it as-is. I'll create an issue to generalize it later on.