TextEditor::clear() not working as expected

I’m trying to clear a TextEditor box after I put some text in it, similar to the following.

myBox.setText (juce::String ("abcde"));
...
myBox.clear();

However, clear() doesn’t delete the text and instead leaves it there. I’m currently using a workaround by calling setText again with a string that has a white space, which would visually clear the TextEditor.

myBox.setText (juce::String (" "));

I’m fairly new to Juce, so am I doing something wrong here?