Problem/Motivation
I realized that if the field we want to limit is inside a Paragraph, it only works on the initial page load (when the paragraph is open by default). On all other interactions (collapsing+opening, adding a new paragraph, etc), our JS doesn't kick-in. We should make sure all paragraph interactions also trigger our JS. Our markup is still there, we just seem to make sure the JS runs again.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork sam-3271601
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
hawkeye.twolfPR up! #3
The basic issue was the
once()being run against thebodyselector. Ajax responses rarely replace the entire body element, so all the code insideonce()was only executing one time per page load.I also took the liberty of making the input text ineditable (type=submit) while I was in there.
Comment #6
marcoscanoThanks @Hawkeye! I've added a quick test, but it looks great! 👍