-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[JENKINS-58240] - Plugins should be able to provide onBlur for codemirror textarea. #4046
Conversation
@rudolfwalter Could you point to a bug in a plugin as the result of this, or a plugin needing to implement this, to illustrate the benefits of this change? |
Sure. I came across this while making jenkinsci/script-security-plugin#255. I added the workaround hack there, and could have left it at that, but thought it would be nicer to actually get it fixed in core so that the hack can be cleaned up later. |
@rudolfwalter my only concern: if a plugin has already implemented the workaround, would it still work properly if this is included? |
@varyvol It should, yes:
|
I can only think of one regression that this could cause: in the case when a plugin provided a wrong onBlur, never noticing its error because its onBlur was being ignored; that error would surface after this change. |
@rudolfwalter I don't see that as a regression but as an error in the plugin, so it could even be positive. Thanks for the explanations! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, it will address the described issue. It would be great to have a JIRA ticket so that we can consider it for backporting
@rudolfwalter Thanks for the patch! I will get it merged once the CI rerun completes. If you want it to be backported to LTS, please comment in the JIRA ticket |
Currently, plugins cannot cleanly provide a custom onBlur handler for their codemirror textareas, because it is being overridden in core. This has been the case since 4e48eaa, but it does not look like that side-effect has been intentional.
(Plugins could work around this in a hackish way, by adding
})//
at the end of their codemirror-config.)Proposed changelog entries
onBlur()
handlers for codemirror textarea controls