I think that this IS the original intent, Surely a long press in a text box should do nothing. What else should it do?
However the previous code did not differntiate between the close button being pressed or the text box being pressed, so I have added what should happenen in the case of the close button being pressed and the text box being (long) pressed.