File Tab Does Not Close If Selected

If I open a file from the filetree, when I try to close the tab by clicking on the X, it doesn’t close the tab.
However, if I click on another tab the one I clicked the X on does close.