Skip to content
Snippets Groups Projects
Commit 8e5b55eb authored by chris's avatar chris
Browse files

fix cursor

parent 1ca44111
No related branches found
No related tags found
1 merge request!458Hhmi accessibility
This commit is part of merge request !458. Comments created here will be created in the context of that merge request.
......@@ -12,5 +12,9 @@ const fontWriting = css`
export default css`
.ProseMirror {
${fontWriting}
.ProseMirror-separator {
display: none !important;
}
}
`;
......@@ -33,16 +33,22 @@ export default props => {
handleDOMEvents: {
focus: (view, event) => {
const fakeCursor = document.getElementsByTagName('fakecursor');
if (fakeCursor && fakeCursor[0])
fakeCursor[0].style.visibility = 'hidden';
if (fakeCursor && fakeCursor[0]) {
for (let i = 0; i < fakeCursor.length; i++) {
fakeCursor[i].style.visibility = 'hidden';
}
}
},
blur: (view, event) => {
if (view && event.relatedTarget === null) {
view.focus();
} else {
const fakeCursor = document.getElementsByTagName('fakecursor');
if (fakeCursor && fakeCursor[0])
fakeCursor[0].style.visibility = 'visible';
if (fakeCursor && fakeCursor[0]) {
for (let i = 0; i < fakeCursor.length; i++) {
fakeCursor[i].style.visibility = 'visible';
}
}
}
},
},
......
......@@ -113,8 +113,9 @@ const DropComponent = ({ getPos, node, view }) => {
if (!isDisabled) setIsOpen(!isOpen);
if (isOpen)
setTimeout(() => {
console.log('here?', activeView);
activeView.focus();
});
}, 100);
};
const onKeyDown = (e, index) => {
......@@ -171,11 +172,9 @@ const DropComponent = ({ getPos, node, view }) => {
tabIndex="0"
type="button"
>
<span>
{selectedOption === null || !selectedOption
? 'Select Option'
: selectedValue[0].label}
</span>
{selectedOption === null || !selectedOption
? 'Select Option'
: selectedValue[0].label}
<StyledIcon name="expand" />
</DropDownButton>
<DropDownMenu isOpen={isOpen} role="menu">
......
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