The dataAttribute functionality for the Placeholder extension doesn't behave as expected #7812
carlnewton
started this conversation in
Feature Requests
Replies: 1 comment 2 replies
|
I suppose it could be done like this: Placeholder.configure({
placeholder: document.querySelector('.editor').dataset.placeholder,
}), |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
It seems that the
dataAttributefunctionality for the Placeholder extension allows the placeholder value, as set in the JavaScript to be populated into a custom data attribute of a paragraph element within the editor. I would expect this functionality to work the other way around -- ie when I populate data-placeholder of the editor element (or another data attribute as specified by the dataAttribute configuration property) in my markup, that value is used as the placeholder, just as with any input that uses theplaceholderattribute. This would allow for a single script to be used on multiple fields with different placeholders. It would also allow for language-specific placeholders to be populated in the markup. I think with the current functionality, I'd have to query a custom data attribute and populate it with the JavaScript to insert language-specific placeholder values. I think this is what the discussion alluding to a more generic approach might be hinting at in this discussion.Ideally I'd be able to write my markup as follows:
with no javascript configuration.
Use Case
Multi-language support within my application
Type
Other
All reactions