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

Allow to prevent AlloyEditor from setting contenteditable to true on its srcNode #291

Merged
merged 1 commit into from
Jul 23, 2015

Conversation

dpobel
Copy link
Contributor

@dpobel dpobel commented Jul 21, 2015

Fixes #290

Note: testing that requires quite some changes in the alloy-editor tests but I'm unsure if the test structure in this patch is the best one.

@ipeychev
Copy link
Contributor

Just started reviewing :)

:octocat: Sent from GH.

@dpobel dpobel force-pushed the 290_keep_contenteditable branch from d50c9e5 to cc8c959 Compare July 23, 2015 11:38
@dpobel
Copy link
Contributor Author

dpobel commented Jul 23, 2015

I updated the patch after the discussion in #290 but this does not work yet because of a bug in the implementation of writeOnce attribute together with a default value. Because of the order of the conditions in https://github.com/liferay/alloy-editor/blob/master/src/ui/react/src/oop/attribute.js#L140, the default value always overrides the value provided in the configuration.

How should I proceed with this bug affecting the current patch ? Should I open a separate issue for this one ? Can I fix this issue in this PR or should I open a different one ? And last, are there any tests on the Attribute code?

@dpobel dpobel changed the title Keep the contenteditable attribute value if set Allow to prevent AlloyEditor from setting contenteditable to true on its srcNode Jul 23, 2015
@ipeychev
Copy link
Contributor

Hey @dpobel

Thanks for the patch! In cases like this, we open a new issue, fix it, create a test and then we continue with the original one. In short - you will have to create another issue.

And yes, we have multiple tests for the Attribute, so I am a bit surprised that we have a bug there, but life if is like this.

@dpobel
Copy link
Contributor Author

dpobel commented Jul 23, 2015

Actually, in the corresponding test, the assertion reproduces the bug https://github.com/liferay/alloy-editor/blob/master/src/ui/react/test/attribute.js#L267. Anyway, I'll fix that in different issue and PR.

@dpobel dpobel force-pushed the 290_keep_contenteditable branch from cc8c959 to ada7c54 Compare July 23, 2015 14:37
@dpobel
Copy link
Contributor Author

dpobel commented Jul 23, 2015

Rebased against master to get the fix for the writeOnce attribute default value and the tests are all green on my setup at least.

@ipeychev
Copy link
Contributor

Just started reviewing :)

:octocat: Sent from GH.

@ipeychev ipeychev merged commit ada7c54 into liferay:master Jul 23, 2015
@ipeychev
Copy link
Contributor

Thank you, pull request merged! See changes here.

:octocat: Sent from GH.

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

Successfully merging this pull request may close these issues.

2 participants