-
Notifications
You must be signed in to change notification settings - Fork 280
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
Widget won't open selections #263
Comments
It is hard to guess, could you submit some reproducible example? |
Here is the HTML: Here is the React JSX: Error I get in console when referring to jquery.js It seems as the button was rendered, I clicked inspect element on it, and it was found. When I highlight text the other toolbar with text option does appear and function. |
The code I cannot run, because it depends on your system, but here are some comments:
Better do it with a div, which has "contenteditable" attribute.
What you mean with "referring to jquery.js"? If CKEDITOR is not defined, it is hard for me to imagine how the other Toolbar would work. On theory that shouldn't be possible. CKEditor is the engine and it is needed for both toolbars. If you click on some of the buttons in the other Toolbar, does the selection change? Does it become bold, italic; can you create links, etc.? |
Removed the error, the text area ckeditor line was useless code that i removed sorry about that. All files do sucessfully make it, however on the other toolbar the selection does change, everything is functional but the hyper link one, the twitter one works. |
Okay. Can you do one of these, please:
I hope you understand - without a way for us to run or at least to see your code running, there is no way to guess what exactly is going on. |
Yea, you can download the zip here : https://github.com/kkotwal94/ReportProcessor |
I'm playing around with the css right now and trying to see if that is the case. |
No, sorry, I meant a zip with the simplest possible set of files based on which we can reproduce the issue. |
https://www.dropbox.com/s/tmyvjrc2vt9rbbz/test.zip?dl=0 I reproduced it, Files/ In this smaller case, I still cannot get it to work, however in the demo I download from the site it works perfectly well. |
https://www.dropbox.com/s/4s32xqadz3769mf/test2.zip?dl=0 Here is even a simpler version without nodejs, its gotta be opened in firefox though, since chrome will fail to send a XHTMLRequest |
Great, thanks! We will debug it and get back to you. |
I've been able to pin down the issue to the With that, I've been able to reproduce it by itself in this branch https://github.com/jbalsas/alloy-editor/tree/AE-263-Exclusive_issue |
Found the bug - basically, it is caused by a race condition. It turns that if there is an input, select, textarea and they are part of the component's hierarchy, like in your case, React first will update the elements and then the code which checks should we hide the UI or not will be invoked. If not, the code will be invoked first and then React will change the components. To fix that, instead to subscribe to 'click' and do the check, we will subscribe to 'mousedown'. In this case, we will do the check and then we will trigger the change of the elements of the Toolbar. Will release a new version in a while. |
I have a couple questions, how did you guys go about debugging that? Like what did you guys check for, or print out, where did you guys start? Secondly, if I want to prefill the text area with html or text, I would just set it to {this.props.getData.body} in between the text area's, I would think. However, that did not work yesterday when I was messing around as well. I was grabbing the data from a ajax call in reactjs as well, and trying to prefill text. I'm going to try to recreate this too. The data I am trying to prefill it with does have markdown, I just want to create a "editForm" where I can prefill the alloy editor with what I had just recently submitted via the alloy editor. Through a POST ajax I get markdown and stuff such as : http://pastebin.com/khL0xULG How should I go about recreating it in or displaying it again in the editor? Here is the problem reproduced: https://www.dropbox.com/s/nx9bzi7jhaf0r8u/test%20%282%29.zip?dl=0 |
On the first question: |
Hey @kkotwal94 About your second question, you'd need to set the Additionally, you could turn the Keep in mind that you should probably wait to initialize the editor after the content is set. Another option would be to use the editor own API for that. |
Just released ver.0.3.6, please try with it. |
The css issue is fixed now, the insert image widget still does not work however. There was no console error, im using the same demo i've been sending as well. Thanks for the great feedback also, I appreciate it. Also, I agree @jbalsas I think that is what i'm going to try. |
Please open an issue, explain what you mean with "image widget" and add a reproducible code so we can take a look. Thanks, |
I'm having a hard time figuring out why when using Alloy Editor, the + widget won't open the selections just like in the demo.
I'm using this with ReactJS, and this is the alloy-editor-all.js file. I've used the no-react file as well. I'm assuming its just a jquery/javascript issue but can't figure it out.
The text was updated successfully, but these errors were encountered: