Skip to content
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

Add an api to update the placeholder text (or maybe any config options?) #1150

Closed
eamodio opened this issue Nov 30, 2016 · 3 comments
Closed

Comments

@eamodio
Copy link

eamodio commented Nov 30, 2016

It would be great if there was an api to update the placeholder text after quill is created.

Having to use

quill.root.dataset.placeholder = 'Your new placeholder';

Feels like reaching into the guts of quill and accessing an implementation detail that could break in the future (it is also undocumented).

It might also be worth a generic configuration options update method or something that isn't just limited to the placeholder.

@jhchen
Copy link
Member

jhchen commented Dec 1, 2016

Many of the configuration options are not meant to and cannot be changed dynamically. I think it is fine to just change the data-placeholder attribute. I'd like to keep Quill light and simple and more layers, features, and APIs challenge that.

@jhchen jhchen closed this as completed Dec 1, 2016
@eamodio
Copy link
Author

eamodio commented Dec 1, 2016

@jhchen I'm all for light and simple, but APIs provide discoverability, isolation from implementation details, and clear supportability (i.e. a contract) -- and if done well don't add bloat. As this method isn't even documented -- I have no assurance that the next version of Quill won't break this behavior. There is no contract there -- not for you nor the user.

The lack of an API and/or documentation causes each user to figure out on their own (i.e. google) what could be simply addressed for everyone. Instead of coming away pleased at Quill from support dynamically updated placeholders in my app, I came away frustrated (for the time I spent figuring it out and not on my application code) and uneasy with the solution.

Now I definitely don't want you to take that the wrong way -- I am VERY happy overall with Quill, but often its the little paper-cuts that sting the worst especially when they could so simply be avoided.

@ivanalejandro0
Copy link

I totally agree with @eamodio.
On my use case, I dynamically change the enabled property along with the placeholder and I'd like to have an API to change the placeholder as we have for enabled.

@jhchen: I respect your call on not having an API for changing the placeholder.
I also think that this particular use case may be common enough to at least add it to the documentation so the users don't have to go through code/issues/docs/google to find out how it can be done.

As a side note (I'm leaving it here in case that someone else needs it as well) you can set the placeholder this way too:

quill.root.setAttribute('data-placeholder', "Your new placeholder");

This is how is done right now on Quill's constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants