- Updated code with @hjones's patch and verified that everything is working as expected.
Combined screenshots of the search field with the close button after the change:
{F8993926}
Differential Revision: https://phabricator.services.mozilla.com/D228285