strictdoc
strictdoc copied to clipboard
Grammar fields: Scroll to the element added with Turbo
We are solving the problem of adding a field to the grammar, in the form inside the modal window. When adding a new field, the form should scroll to the very bottom, and the new field should be fully visible. Now a naive solution is done, using scrollIntoView() for the add field button.
template: strictdoc/export/html/templates/single_document/frame_document_grammar_edit.jinja.html
some links are likely to be helpful: https://gist.github.com/ayamomiji/e755bb1b7f477840e4d66b8a2ba7acea https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView https://turbo.hotwired.dev/handbook/drive