This is normal behavior - when you type it after already typing some characters on the line, it allows the process to read the characters you've typed (you'll notice that you can't backspace past this point, and if you do it in e.g. cat
the characters you typed may be echoed immediately)
The relevant Unix standard can be found here:
EOF
Special character on input, which is recognized if the ICANON flag is set. When received, all the bytes waiting to be read are immediately passed to the process without waiting for a < newline >, and the EOF is discarded. Thus, if there are no bytes waiting (that is, the EOF occurred at the beginning of a line), a byte count of zero shall be returned from the read(), representing an end-of-file indication. If ICANON is set, the EOF character shall be discarded when processed.
Basically, ctrl-D in the middle of the line isn't "really" the end of the file, and there's no reason to expect to detect it. If you want to end standard input without a final newline, just press ctrl-D twice.