Cursor Applies Changes to Incorrect File When Not Opened

When using the apply changes feature, Cursor applies it to the wrong file if the file is not opened even though it specified the right file. For example, I asked it to modify fetchSurveys.ts. It provides the suggested changes, and the button Apply to fetchSurveys.ts appears. However, if I have another file opened instead of fetchSurveys.ts, the button will change to that file, for eg. Apply to input_surveys.json. Then, if I click it, it will apply the changes to input_surveys.json instead of fetchSurveys.ts. I would then need to resend the prompt as the reapply will keep trying to reapply to the file it modified just now.

I remember this used to not be an issue, Cursor would be able to apply the changes to whatever file it’s meant to modify instead of what file is currently opened.