https://www.reddit.com/r/IsItBullshit/comments/z6itj3/comment/iy325ds/
This is the comment and discussion that made me ask.
Japanese soldiers were using katanas on the same battlefields through 1945.
However, to be laconic: yes, firearms and many traditional bladed weapons (including katanas) shared the same battlefields in Korea and Japan through the Sengoku period, the Imjin War, and even through the conflicts of the Meiji Restoration, such as the Boshin War and the Satsuma Rebellion.
/u/LTercero goes into detail on the development of firearms in Japan here.
/u/ParallelPain goes into more detail on conflict in Japan during the famous Sengoku period here.