New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In usercard error appears only once #6104
Labels
Bug
Something isn't working
Comments
freddidierRTE
changed the title
Could not send card after an error
In usercard error appears only once
Mar 11, 2024
freddidierRTE
added a commit
that referenced
this issue
Mar 11, 2024
This commit resolves an issue where the usercard error would only appear once due to the use of the global flag (/g) in a JavaScript regular expression. The issue was that calling this.EMPTY_REGEXP.test(this.quill.root.innerHTML) on the same string would return true the first time and false subsequently. The global flag causes the RegExp.test() method to alternate between matching and not matching the regex, as explained in the official MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag This behavior is discussed in this Medium article: https://medium.com/@nikjohn/regex-test-returns-alternating-results-bd9a1ae42cdd Signed-off-by: freddidierRTE <frederic-f.didier@rte-france.com>
freddidierRTE
added a commit
that referenced
this issue
Mar 12, 2024
This commit resolves an issue where the usercard error would only appear once due to the use of the global flag (/g) in a JavaScript regular expression. The issue was that calling this.EMPTY_REGEXP.test(this.quill.root.innerHTML) on the same string would return true the first time and false subsequently. The global flag causes the RegExp.test() method to alternate between matching and not matching the regex, as explained in the official MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag Signed-off-by: freddidierRTE <frederic-f.didier@rte-france.com>
freddidierRTE
added a commit
that referenced
this issue
Mar 12, 2024
This commit resolves an issue where the usercard error would only appear once due to the use of the global flag (/g) in a JavaScript regular expression. The issue was that calling this.EMPTY_REGEXP.test(this.quill.root.innerHTML) on the same string would return true the first time and false subsequently. The global flag causes the RegExp.test() method to alternate between matching and not matching the regex, as explained in the official MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag Signed-off-by: freddidierRTE <frederic-f.didier@rte-france.com>
ClementBouvierN
pushed a commit
that referenced
this issue
Mar 12, 2024
This commit resolves an issue where the usercard error would only appear once due to the use of the global flag (/g) in a JavaScript regular expression. The issue was that calling this.EMPTY_REGEXP.test(this.quill.root.innerHTML) on the same string would return true the first time and false subsequently. The global flag causes the RegExp.test() method to alternate between matching and not matching the regex, as explained in the official MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag Signed-off-by: freddidierRTE <frederic-f.didier@rte-france.com>
ClementBouvierN
pushed a commit
that referenced
this issue
Mar 12, 2024
This commit resolves an issue where the usercard error would only appear once due to the use of the global flag (/g) in a JavaScript regular expression. The issue was that calling this.EMPTY_REGEXP.test(this.quill.root.innerHTML) on the same string would return true the first time and false subsequently. The global flag causes the RegExp.test() method to alternate between matching and not matching the regex, as explained in the official MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag Signed-off-by: freddidierRTE <frederic-f.didier@rte-france.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To reroduce
Go to user card
Click on "See before sending"
An error " You must provide a message" appears
Remove error message
Click on "See before sending"
Nothing happens and exception in console
The text was updated successfully, but these errors were encountered: