'When editing Additional CSS in WordPress webpage redirects to Homepage

I am having a weird issue I can't figure out. I am creating a SaaS App for a client using WP as the framework. I am creating shortcodes to place the content/code on each of the pages. The FrontEnd Dev is having an issue when they select a page to edit the Additional CSS in Customizing, as soon as they hit any key on the keyboard the page automatically redirects to the Homepage of the site. But it is not redirecting like when you click on a link, it seems like it just automatically replaces the shortcode content with the Homepage shortcode. It's really weird.

It doesn't matter what page I am on it will do it. Even pages where I don't have a shortcode on it, it's just a blank page. No errors in the console.

The actual SaaS App when not viewing it from the CMS of WordPress works just fine with no problems.

Any ideas?

UPDATE

I have been spending hours on this and I have just discovered the issue, problem now is that I have to figure out why it's doing it. Here is my update.

In my application I have some <a> (Links) that I code in using either window.location.href or window.location.replace. Using the app from the front-end there are no issues at all. BUT If you go to customize the theme from the WP Backend whenever you hit a key on the keyboard in "Additional CSS" it causes the site to go back to the previous page you were on when clicking a link that uses the redirects I mentioned. If I hardcode those links without using code then nothing happens and the pages do not redirect as intended. So the issue has something to do with using the coded redirects. I know when customizing a theme WP updates those changes live. I can see in console admin-ajax.php being called when editing the CSS. That is what I have so far.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source