Notifications
Clear all

[Closed] Error with Comment Form if User has the Grammarly Browser Extension Enabled

7 Posts
4 Users
2 Reactions
3,217 Views
(@mrhappywork)
New Member
Joined: 6 years ago
Posts: 1
Topic starter  

Hello. I am running into an issue with the comment form not playing nicely with the Grammarly add-on extensions for Firefox and Chrome. Here is what happens when a user has the Grammarly add-on enabled.

1. If a user clicks the comment box, but before typing anything in the box, clicks outside of the comment box, the box gets a red highlight around it.

2. Once this happens, the user is unable to use the comment box as normal. If clicking back in the box, the typing cursor will not appear, and if the user enters text, it actually enters it in white (invisible) font. If you highlight the box, you can see it. If you try to submit the comment in this state, the form gives an error saying “Please fill out this field” (pointing to the comment box)

3. The only workaround I know is to refresh the page and avoid clicking outside the comment box once you click in it. (or else the error in #1 and #2 happens again).

4. I noticed if I disable the Grammarly add-on, everything works as normal.

Is this a known issue? Is there some setting or another workaround that can allow users with Grammarly add on to not run into this error?

Please see attached screenshots.

WPDiscuz issue2
WPDiscuz issue

   
Nesty Dev reacted
Topic Tags
Astghik
(@astgh)
Illustrious Member Admin
Joined: 7 years ago
Posts: 6191
 

Hi mrhappywork,

Thank you for letting us know.

We'll take it into consideration for future releases.


   
(@nesty-dev)
Active Member
Joined: 6 years ago
Posts: 10
 

Hi guys.

I just want to say that I'm having the same issue so that the support team gives it a higher priority.

I hope that they fix it in the next update.

And thanks for this great plugin. 


   
(@nesty-dev)
Active Member
Joined: 6 years ago
Posts: 10
 

[Update

I have noted that the issue happens in Microsoft Edge browser too.


   
(@nesty-dev)
Active Member
Joined: 6 years ago
Posts: 10
 

[Update]

@mrhappywork

@Astghik

I have been trying to solve the problem for some time.

Currently, I guess the problem is that the comment focus jQuery delegate inside the wp_discuz.js file, isn't firing if the Grammarly extension is active, since clicking on the comment form results in the click registered on the Grammarly temp form, not on the wpDiscuz comment form.

So I think there should be another delegate the registers for the Grammarly temp form in case it exists,  the problem here is though, that the temp form won't be created until the user clicks on the comment form, so maybe we should register the delegate there?

var grammarly=$("grammarlyghost");

if(grammarly!==null&&grammarly!==undefined){
var child_div=$("grammarlyghost div:first");

child_div=$("grammarlyghost").children(":first");

if(child_div!==null&&child_div!==undefined){

vardiv_id=child_div.attr('class');
$(document).delegate('.'+div_id,'focus',function(){
varparent=$(this).parents('.wc-form-wrapper');

$('.commentTextMaxLength',parent).show();

$('.wc-form-footer',parent).slideDown(enableDropAnimation);

});

   
(@nesty-dev)
Active Member
Joined: 6 years ago
Posts: 10
 

[Update]

@mrhappywork

@Astghik

I have been trying to solve the problem for some time.

Currently, I guess the problem is that the comment focus jQuery delegate (event handler) inside the wp_discuz.js file, isn't firing if the Grammarly extension is active, since clicking on the comment form results in the click registered on the Grammarly temp form, not on the wpDiscuz comment form.

So I think there should be another delegate the registers for the Grammarly temp form in case it exists,  the problem here is though, that the temp form won't be created until the user clicks on the comment form, so maybe we should register the delegate there?

Here's a piece of code I have tried, grammarlyghost is the name of the tag for the temp form parent, the temp form is a div, so what I'm trying to do is add an event handler on focus for that div, but the issue is that the div_id variable returns undefined, any help would be appreciated.

var grammarly = $("grammarlyghost");

if(grammarly !==null && grammarly !== undefined){
var child_div = $("grammarlyghost div:first");

child_div = $("grammarlyghost").children(":first");
if(child_div !== null && child_div !== undefined){

var div_id = child_div.attr('class');
$(document).delegate('.'+div_id,'focus',function(){
var parent=$(this).parents('.wc-form-wrapper');
$('.commentTextMaxLength',parent).show();
$('.wc-form-footer',parent).slideDown(enableDropAnimation);
});

}
This post was modified 6 years ago 2 times by Nesty Dev

   
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4214
 

I'm sorry but we have no any suggestion here. The only thing I can suggest is removing the avatar from textarea using a simple CSS code. Please put it in Dashboard > Comments > Settings > Stylings > Custom CSS Code textarea. Save it, delete all caches and press Ctrl+F5 on website front-end:

#wpcomm .wc_comm_form.wc_main_comm_form .wc-field-comment .wc-field-avatararea {
      visibility: hidden; width: 0px; height: 0px;
}
#wpcomm .wc_comm_form.wc_main_comm_form .wc-field-textarea .wpdiscuz-textarea-wrap textarea {
      padding: 25px 25px 0px 25px!important;
}

I'm closing this topic here. If we got some solution I'll update.

Thank you for helping to find a solution.


   
Nesty Dev reacted
Share:
Scroll to top