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

Fix #5960: Quill 2.0.0 support #6429

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions components/doc/editor/accessibilitydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { DocSectionText } from '@/components/doc/common/docsectiontext';
export function AccessibilityDoc() {
return (
<DocSectionText id="accessibility" label="Accessibility">
<p>
Quill performs generally well in terms of accessibility. The elements in the toolbar can be tabbed and have the necessary ARIA roles/attributes for screen readers. One known limitation is the lack of arrow key support for{' '}
<a href="https://github.com/quilljs/quill/issues/1031">dropdowns</a> in the toolbar that may be overcome with a custom toolbar.
</p>
<p>Quill performs generally well in terms of accessibility. The elements in the toolbar can be tabbed and have the necessary ARIA roles/attributes for screen readers.</p>
</DocSectionText>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/basicdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function BasicDemo() {
<div className="card">
<Editor value={text} onTextChange={(e) => setText(e.htmlValue)} style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/readonlydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ReadOnlyDemo() {
<div className="card">
<Editor value="Always bet on Prime!" readOnly style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/templatedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function TemplateDemo() {
<div className="card">
<Editor value={text} onTextChange={(e) => setText(e.htmlValue)} headerTemplate={header} style={{ height: '320px' }} />
</div>
<DocSectionCode code={code} dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code} dependencies={{ quill: '2.0.0' }} />
</>
);
}
2 changes: 1 addition & 1 deletion components/doc/editor/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function UnstyledDemo() {
</p>
<DocSectionCode code={code} hideToggleCode import hideStackBlitz />
<p>A playground sample with the pre-built Tailwind theme.</p>
<DocSectionCode code={code2} embedded dependencies={{ quill: '1.3.7' }} />
<DocSectionCode code={code2} embedded dependencies={{ quill: '2.0.0' }} />
</DocSectionText>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions components/lib/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const Editor = React.memo(
quill.current = quillInstance;

if (props.value) {
quill.current.setContents(quill.current.clipboard.convert(props.value));
quill.current.clipboard.dangerouslyPasteHTML(props.value);
}

setQuillCreated(true);
Expand Down Expand Up @@ -151,7 +151,7 @@ export const Editor = React.memo(

useUpdateEffect(() => {
if (quill.current && !quill.current.hasFocus()) {
props.value ? quill.current.setContents(quill.current.clipboard.convert(props.value)) : quill.current.setText('');
props.value ? quill.current.clipboard.dangerouslyPasteHTML(props.value) : quill.current.setText('');
}
}, [props.value]);

Expand Down
78 changes: 0 additions & 78 deletions components/lib/editor/Editor.spec.js

This file was deleted.

Loading
Loading