Generalize the Popover.addComponent method (#14127)

Change-Id: I6a4df132e2be96faa892ae412c5b37559ad193f8