How to customize commenting feature: Replace loading spinner and disable Enter key submission? Answered

Post author
Jack Ellis

Is it possible to change the commenting loader or delete it in entirety? I always get a green spinner in my commenting section which doesn't look great from a UI perspective...

Comments

5 comments

  • Comment author
    A J
    Hey Jack Ellis, I am not sure which exact commenting cloneable you are using.
     
    But this solution should work in similar ways for you as well.
     
    In your commenting page, you can find the green loader in a div block in the navigation bar (shown in screenshot) and you can customize this as per your design or delete it as per your preference and the green loader will not be visible after publishing the site.
     
    Hope this helps.
     
    0
  • Comment author
    Jack Ellis

    Ahhhh AJ! Lifesaver! I had been messing around with it and deleting them and then I realized there were two different loading spinners in the cloneable! Thanks so much, deleted them both 🙂

    0
  • Comment author
    Igor Voroshilov

    Hello, everyone! I have a question about commenting feature. Is there a way to prevent sending a comment by pressing Return (Enter) button when type in a form? I want to make posting possible only by pressing a submit button.

    0
  • Comment author
    Chukwudi Onyekwere

    Hi Igor,

    You can achieve this with Javascript. This script below when placed on the page, prevents the comment from being submitted when the "Enter" key is pressed.

    <script> 
    document.addEventListener("DOMContentLoaded", function() {
    const form = document.querySelector('form[data-ms-form="post"]');

    if (form) {
    form.addEventListener("keypress", function(event) {
    if (event.key === "Enter") {
    event.preventDefault(); // Prevent form submission when "Enter" is pressed
    }
    });
    }
    });
    </script>

    If it didn't work. Try this

    <script> 
    document.addEventListener("DOMContentLoaded", function() { document.addEventListener("keypress", function(event) {
    if (event.key === "Enter") {
    event.preventDefault(); // Prevent form submission or any default action when "Enter" is pressed
    }
    });
    });
    </script>
    0
  • Comment author
    Igor Voroshilov

    Hello, Chukwudi Onyekwere! Thank you so much! I will try the 2nd solution

    Unfortunately the 1st solution didn’t work. The comment is still submitted. I guess that MS itself prevents the form from default behavior and uses submit as a trigger to create a post.

    I will be happy to receive some further help. Here are my live url and share link.
    https://test-ms-comments.webflow.io/
    https://preview.webflow.com/preview/test-ms-comments?utm_medium=preview_link&utm_sourc[…]s&preview=49f87a76ea085c22cb1f280a57d096e8&workflow=preview

    0

Please sign in to leave a comment.