-
Notifications
You must be signed in to change notification settings - Fork 29
Description
I was scared of doing this earlier because I was afraid it could cause a breaking change between code-input.js and especially third-party plugins which may delete or mess with code-input elements' contents beforeElementsAdded, e.g. to change the value. Also, third-party code may check for the existence of the textareaElement property to know when a code-input element's template has been registered.
However, it is not a breaking change and may only cause incompatibilities between external plugins/third-party-code and people's use of fallback textareas, not with the whole code-input.js library. The old non-fallback-textarea approach will still be supported throughout major version 2, and can be used to resolve such incompatibilities (this should be documented). Upgrading without doing anything else will not switch to fallback textareas, so not cause any breaking changes! Unfortunately, enough time has been left after the fallback textareas that this is now a breaking change unless implemented with e.g. a custom attribute to switch it on. It's not really too much of an issue, though, with the current code, and more major cleanup including this would go well in v3!
This will shorten core attribute-syncing and event-syncing code.
Attributes still need to be transferred during setup as they are now.