mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Use open-color directly (#1371)
This commit is contained in:
parent
6d30351164
commit
f7e3ee2064
27 changed files with 3283 additions and 197 deletions
|
@ -124,13 +124,14 @@ const Picker = function ({
|
|||
{colors.map((_color, i) => (
|
||||
<button
|
||||
className="color-picker-swatch"
|
||||
onClick={() => {
|
||||
onClick={(event) => {
|
||||
(event.currentTarget as HTMLButtonElement).focus();
|
||||
onChange(_color);
|
||||
}}
|
||||
title={`${_color} — ${keyBindings[i].toUpperCase()}`}
|
||||
aria-label={_color}
|
||||
aria-keyshortcuts={keyBindings[i]}
|
||||
style={{ backgroundColor: _color }}
|
||||
style={{ color: _color }}
|
||||
key={_color}
|
||||
ref={(el) => {
|
||||
if (el && i === 0) {
|
||||
|
@ -250,7 +251,11 @@ export function ColorPicker({
|
|||
</div>
|
||||
<React.Suspense fallback="">
|
||||
{isActive ? (
|
||||
<Popover onCloseRequest={() => setActive(false)}>
|
||||
<Popover
|
||||
onCloseRequest={(event) =>
|
||||
event.target !== pickerButton.current && setActive(false)
|
||||
}
|
||||
>
|
||||
<Picker
|
||||
colors={colors[type]}
|
||||
color={color || null}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue