I wrote my own plugin that generates a simple link. The strange thing is that I cannot edit the "href" attribute. Other attributes can be edited.
This item does not work:
{
type: 'text',
id: 'url',
label: 'URL',
commit: function(element) {
element.setAttribute('href', this.getValue());
},
setup: function(element) {
this.setValue(element.getAttribute('href'));
}
}
When I create the link, the href attribute is written. When I edit the link, the "href" attribute does not change. Weird!
When I change the code above and rewrite the attribute name, for example, to "href-s":
{
type: 'text',
id: 'url',
label: 'URL',
commit: function(element) {
element.setAttribute('href-s', this.getValue());
},
setup: function(element) {
this.setValue(element.getAttribute('href-s'));
}
}
The create and edit attribute works great.
You do not know what the problem is?
Thank.
source
share