Skip to content

Commit

Permalink
Merge pull request #400 from qoretechnologies:bugfix/rich-editor-fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
Foxhoundn authored Jul 18, 2024
2 parents 05b84e6 + ba7ecf1 commit 0d7f35e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qoretechnologies/reqore",
"version": "0.48.0",
"version": "0.48.1",
"description": "ReQore is a highly theme-able and modular UI library for React",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/components/RichTextEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,14 @@ export const ReqoreRichTextEditor = ({
isEmpty
? undefined
: () => {
onChange([{ type: 'paragraph', children: [{ text: '' }] }]);
Transforms.delete(editor, {
at: {
anchor: Editor.start(editor, []),
focus: Editor.end(editor, []),
},
});
// Focus the editor
ReactEditor.focus(editor);
}
}
value={JSON.stringify(value || [])}
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/usePopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ const usePopover = ({
};

const _removePopover = () => {
cancelTimeout();

if (isPopoverOpen(id)) {
cancelTimeout();
removePopover?.(id);
}
};
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export { ReqorePanel } from './components/Panel';
export { IReqoreParagraphProps, ReqoreP, ReqoreP as ReqoreParagraph } from './components/Paragraph';
export { default as ReqorePopover } from './components/Popover';
export { default as ReqoreRadioGroup } from './components/RadioGroup';
export { IReqoreRichTextEditorProps, ReqoreRichTextEditor } from './components/RichTextEditor';
export * from './components/Slider';
export { ReqoreHorizontalSpacer, ReqoreSpacer, ReqoreVerticalSpacer } from './components/Spacer';
export { IReqoreSpanProps, ReqoreSpan } from './components/Span';
Expand Down
2 changes: 0 additions & 2 deletions src/stories/DatePicker/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const meta = {
render(args) {
const [value, setValue] = useState<Date | string>(args.value);

console.log(args);

return (
<DatePicker
{...args}
Expand Down
1 change: 0 additions & 1 deletion src/stories/Popover/Popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ export const TooltipIsUpdatedWhenContentChanges: Story = {
},

play: async ({ canvasElement, ...rest }) => {
console.log(rest.args);
const canvas = within(canvasElement);
const textarea = canvasElement.querySelector('textarea');
await sleep(500);
Expand Down
3 changes: 0 additions & 3 deletions src/stories/RichTextEditor/RichTextEditor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import { FlatArg, IconArg, MinimalArg, SizeArg } from '../utils/args';
const meta = {
title: 'Form/RichTextEditor',
component: ReqoreRichTextEditor,
args: {
onChange: (data) => console.log(data),
},
render: (args) => {
const [value, setValue] = useState(args.value);

Expand Down

0 comments on commit 0d7f35e

Please sign in to comment.