Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-4ed5ec60d committed Mar 25, 2022
1 parent 1a12288 commit 041f4c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface PickerState {
colorType: ColorType;
}

const dataset = new WeakMap<HTMLInputElement, PickerState>();
const pickerState = new WeakMap<HTMLInputElement, PickerState>();

enum ColorType {
rgb = 'RGB',
Expand Down Expand Up @@ -380,11 +380,10 @@ class ColorPickerWidget extends WidgetType {

toDOM() {
const picker = document.createElement('input');
pickerState.set(picker, this.state);
picker.type = 'color';
picker.value = this.color;

dataset.set(picker, this.state);

const wrapper = document.createElement('span');
wrapper.appendChild(picker);
wrapper.className = wrapperClassName;
Expand Down Expand Up @@ -455,7 +454,7 @@ const colorPickerViewPlugin = (options: CSSColorPickerOptions) =>
return false;
}

const data = dataset.get(target)!;
const data = pickerState.get(target)!;

let converted = target.value + data.alpha;
if (data.colorType === ColorType.rgb) {
Expand Down

0 comments on commit 041f4c1

Please sign in to comment.