Skip to content
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

Getting random text in editor. #9

Closed
rohanpansare opened this issue Apr 13, 2016 · 5 comments
Closed

Getting random text in editor. #9

rohanpansare opened this issue Apr 13, 2016 · 5 comments

Comments

@rohanpansare
Copy link

Hi,
This is Rohan. I had some doubt , I embedded ace-widget tag in polymer webpage. I am getting this text "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" in the editor.
Could you please let me know the source of error. Please find attachment.
Thanks,
Rohan.

screenshot 66
screenshot 67

@LostInBrittany
Copy link
Owner

Sorry, it's a case of bad initialisation, when no initial code is given the default is that 'XXXXX....'

I'm going to correct that to have a more sensible default, like an empty text...

Thanks for the issue!

@LostInBrittany
Copy link
Owner

Are you sure you're using the latest version of the widget?

I've just tested with it, the problem isn't there anymore.

I've added a test on demo/index.html with empty content.

Could you please test the last with Polyserve or integrating it in your project?

@rohanpansare
Copy link
Author

Hi,
I updated the widget now. I am not seeing the "XXXXXX..." text in the editor now but when reading the text using the editor.getSession().getValue() method it appends the linenumber and "XXXX.." text at the end of the editor text . Please see attachment.

ace-widget id="editor" theme="ace/theme/monokai" mode="ace/mode/json"
{Some Text}
ace-widget
After entering some text I did this
var editor = ace.edit("editor");
var myVar = editor.getSession().getValue();
alert(myVar);

Thanks,
Rohan.
pasted_image_at_2016_04_13_12_40_pm

@LostInBrittany
Copy link
Owner

Going to test it, and correct it, thanks!

@LostInBrittany
Copy link
Owner

I've done an explicit initialization to '', so you shouldn't find that problem anymore.

I've also added a log at the end of the initialization method to show the current value, you can see it in demo/index.html to be sure that in the case of empty content the value is also empty.

Can you please test it agais and tell me if it works for you ?

demo/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants