-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Make link placeholder change possible #1107
Comments
The link placeholder is hard coded here. Temp workaround: var quill = new Quill('#editor-container', {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block', 'link']
]
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
});
// change the link placeholder to www.github.com
var tooltip = quill.theme.tooltip;
var input = tooltip.root.querySelector("input[data-link]");
input.dataset.link = 'www.github.com'; |
The ability to change it would be amazing -- and even then, the default should have a 'http://' in front, please! Right now it is a incorrect example, and users that follow it will make broken links. |
Is defaulting to relative links considered a feature or a bug here? I have a lot of people complaining about this in our app and I'm wondering if we should patch locally or upstream. |
This particular issue is about the default placeholder text, which the ability to customize is more a feature than a bug. I did just make a change to add Interpreting what the user enters as a link or not, relative or absolute is already customizable: #550. |
Has this been added? I can't seem to find a way to customize the link placeholder.. |
Would it be an option to make the default value an empty text or https://example.com (a domain created for this purpose)? |
This is absolutely weird and ridiculous to add |
@benbro's workaround didn't quite work for me (using const SnowTheme = Quill.import('themes/snow');
class SnowThemeFix extends SnowTheme {
extendToolbar(toolbar) {
super.extendToolbar(toolbar);
this.tooltip.textbox.dataset.link = ""; // you can set the placeholder to whatever you want here
}
}
Quill.register('themes/snow', SnowThemeFix, true); |
I updated the placeholders in Something like this: ...
const quillRef = useRef<ReactQuill>(null);
const quillInstance = quillRef.current?.getEditor();
const tooltip = quillInstance.theme?.tooltip;
tooltip.textbox.setAttribute("data-link", "https://...");
... |
Make link placeholder change possible
Expected behavior:
Being able to set a different placeholder for links
Actual behavior:
quilljs.com is shown
Version:
1.1.3
The text was updated successfully, but these errors were encountered: