Show clear button if text is present on field focus

In my application, I am programmatically setting the text field in some cases. 

I thought the clear button should show any time the field has focus if there was text in it. Currently, the clear button would only be shown if edits were made to the existing text.