I have a text field that starts out as one line and can sometimes expand to multiple lines. When it's one line I'd like to have a cancel button in it like this: (Enter text here X), but I'm not sure what to do for the case where the text field has expanded to multiple lines, where should I put the cancel button?
I assume the text field grows when it expands to multiple lines? If so -
Just make sure that the placement of the cancel button is consistent. Put it to the top right inside the textfield and make sure the padding from the top and the right stays the same when your text field expands from a single to a multiple. That way it doesn't move when the box expands so the user always knows where and what it's for.
I imagine an effective visual of this would be a simple circular button with an x in the middle.
Google+ has a great interactive way of doing this upfront making the text field expand when you click on it - even before you type.