The "Done" button in the command block UI becomes grayed out when any key (besides keys with functions within the UI, like esc or enter) is pressed while the typing box is blank.
While pressing enter does always work to set the command, this issue is especially annoying after pasting in a command, as that does not update the "Done" button either.
Duplicate of MC-121377. Please use the search function next time.