Skip to content

Commit 943bbda

Browse files
samuelreichertgjulivan
authored andcommitted
chore(rich-text-web): update createColorPicker onChange behavior
1 parent 2258cab commit 943bbda

File tree

3 files changed

+93
-215
lines changed

3 files changed

+93
-215
lines changed

packages/pluggableWidgets/rich-text-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"@codemirror/lang-html": "^6.4.9",
4747
"@floating-ui/react": "^0.26.27",
48-
"@melloware/coloris": "^0.24.0",
48+
"@melloware/coloris": "^0.24.2",
4949
"@uiw/codemirror-theme-github": "^4.21.25",
5050
"@uiw/react-codemirror": "^4.21.25",
5151
"classnames": "^2.2.6",

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/ui/table-properties-form.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class TablePropertiesForm {
8585
this.borderForm = [];
8686
this.saveButton = null;
8787
this.form = this.createPropertiesForm(options);
88-
this.createColorPicker();
8988
}
9089

9190
checkBtnsAction(status: string) {
@@ -159,7 +158,7 @@ class TablePropertiesForm {
159158
const input = this.createColorInput(child);
160159
const inputEl = input.querySelector("input");
161160
if (inputEl) {
162-
this.setColorPicker(inputEl);
161+
this.createColorPicker(inputEl);
163162
}
164163
container.appendChild(input);
165164
return container;
@@ -187,12 +186,12 @@ class TablePropertiesForm {
187186
return container;
188187
}
189188

190-
createColorPicker(): void {
189+
createColorPicker(input: HTMLInputElement) {
191190
Coloris.init();
192191
Coloris({
192+
el: input,
193193
clearButton: true,
194194
closeButton: true,
195-
// @ts-ignore
196195
onChange: (color: string, input: HTMLElement): void => {
197196
const propertyName = input.getAttribute("data-property") ?? "";
198197
this.setAttribute(propertyName, color, input);
@@ -202,10 +201,6 @@ class TablePropertiesForm {
202201
});
203202
}
204203

205-
setColorPicker(input: HTMLInputElement) {
206-
Coloris.coloris({ el: input });
207-
}
208-
209204
createDropdown(value: string) {
210205
const ownerDocument = this.tableMenus.quill.root.ownerDocument;
211206
const dropdown = ownerDocument.createElement("div");

0 commit comments

Comments
 (0)