attributes are editable for readonly elements
Posted: Tue May 28, 2024 6:04 pm
Using an AuthorNodeCssCustomizer, I have made certain elements of a DITA file readonly by setting
This works pretty good: editing the element's content is not possible, and everything in the attributes view is grayed out. When I doubleclick the element, the "Generate Unique ID Value" button in the in-place attributes editor is also grayed out. BUT: it is still possible to manually enter a new value in the input field next to it. Is there a reason for this inconsistency, or is this a bug?
Following this suggestion by Radu, I implemented a CustomAttributeValueEditor, but this does not help either, because it only takes effect after clicking the "Generate Unique ID Value" button, which is grayed out anyway on readonly elements.
As a workaround, I'm testing with an AuthorAttributesDisplayFilter to filter unwanted attributes. That's okay for me, but I still think that attributes of readonly elements should not be editable in the in-place attributes editor.
Greetings,
Dirk
Code: Select all
styles.setProperty(Styles.KEY_EDITABLE, Boolean.valueOf(editable));
Following this suggestion by Radu, I implemented a CustomAttributeValueEditor, but this does not help either, because it only takes effect after clicking the "Generate Unique ID Value" button, which is grayed out anyway on readonly elements.
As a workaround, I'm testing with an AuthorAttributesDisplayFilter to filter unwanted attributes. That's okay for me, but I still think that attributes of readonly elements should not be editable in the in-place attributes editor.
Greetings,
Dirk