Hi all
So all my gatsby sites are plagued by the dreaded “cursor jumps to the end of the paragraph” bug that is in Chrome and Firefox browsers. The fix was to add an admin.css file to static/admin and include this line:
[data-slate-editor] {
-webkit-user-modify: read-write !important;
}
I have tested it in the chrome inspector for that element and it works.
So, I followed the instructions for gatsby dynamically adding the admin.css to the header in the cms-utils.js file like so:
if (typeof window !== "undefined") {
// add admin.css
const link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = "/admin/admin.css";
document.head.appendChild(link);
if (process.env.NETLIFY_SITE_URL) {
window.localStorage.setItem(
"netlifySiteURL",
process.env.NETLIFY_SITE_URL
);
}
}
then imported into the cms.js file :
import "./cms-utils";
import CMS from "netlify-cms-app";
...
I push everything up to github, it builds fine. I can login fine. Only problem is the cms.js is not being used at all. I even commented out all the code and pushed…nothing. Admin still loads and the cursor still jumps to the end.
here is the site for admins: jackalopeadventures.com
thanks for the help!