Skip to content
Snippets Groups Projects
Commit 1a7d0b67 authored by chris's avatar chris
Browse files

set disabled

parent 2f74b47b
No related branches found
No related tags found
1 merge request!458Hhmi accessibility
......@@ -20,14 +20,13 @@ import { v4 as uuidv4 } from 'uuid';
const Wrapper = styled.div`
opacity: ${props => (props.disabled ? '0.4' : '1')};
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
`;
const DropDownButton = styled.button`
background: #fff;
border: none;
color: #000;
cursor: pointer;
cursor: ${props => (props.disabled ? `not-allowed` : `pointer`)};
display: flex;
position: relative;
width: 160px;
......@@ -86,7 +85,7 @@ const DropComponent = ({ getPos, node, view }) => {
return editable;
});
const isDisabled = false;
const isDisabled = !isEditable;
const onChange = option => {
const allNodes = getNodes(main);
......@@ -163,6 +162,7 @@ const DropComponent = ({ getPos, node, view }) => {
<DropDownButton
aria-expanded={isOpen}
aria-haspopup
disabled={isDisabled}
onKeyDown={e => {
e.preventDefault();
if (e.keyCode === 40) {
......
......@@ -13,14 +13,13 @@ import { WaxContext, Icon, useOnClickOutside } from 'wax-prosemirror-core';
const Wrapper = styled.div`
opacity: ${props => (props.disabled ? '0.4' : '1')};
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
`;
const DropDownButton = styled.button`
background: #fff;
border: none;
color: #000;
cursor: pointer;
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
display: flex;
position: relative;
width: 160px;
......@@ -136,6 +135,7 @@ const TableDropDown = ({ item }) => {
<DropDownButton
aria-expanded={isOpen}
aria-haspopup
disabled={isDisabled}
onKeyDown={e => {
e.preventDefault();
if (e.keyCode === 40) {
......
......@@ -13,14 +13,13 @@ import { WaxContext, Icon, useOnClickOutside } from 'wax-prosemirror-core';
const Wrapper = styled.div`
opacity: ${props => (props.disabled ? '0.4' : '1')};
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
`;
const DropDownButton = styled.button`
background: #fff;
border: none;
color: #000;
cursor: pointer;
cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};
display: flex;
position: relative;
width: 215px;
......@@ -195,6 +194,7 @@ const DropDownComponent = ({ view, tools }) => {
<DropDownButton
aria-expanded={isOpen}
aria-haspopup
disabled={isDisabled}
onKeyDown={e => {
e.preventDefault();
if (e.keyCode === 40) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment