Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to control disabled properties? #269

Closed
goudanz opened this issue Sep 26, 2021 · 1 comment
Closed

How to control disabled properties? #269

goudanz opened this issue Sep 26, 2021 · 1 comment

Comments

@goudanz
Copy link

goudanz commented Sep 26, 2021

I want to control the disabled property of editor from the main component.

I looked at the attributes in the source code and couldn't find disabled;

export interface MDEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, IProps {
    /**
     * The Markdown value.
     */
    value?: string;
    /**
     * Event handler for the `onChange` event.
     */
    onChange?: (value?: string) => void;
    /**
     * Can be used to make `Markdown Editor` focus itself on initialization. Defaults to on.
     * it will be set to true when either the source `textarea` is focused,
     * or it has an `autofocus` attribute and no other element is focused.
     */
    autoFocus?: ITextAreaProps['autoFocus'];
    /**
     * The height of the editor.
     */
    height?: number;
    /**
     * Custom toolbar heigth
     * @default 29px
     */
    toolbarHeight?: number;
    /**
     * Show drag and drop tool. Set the height of the editor.
     */
    visiableDragbar?: boolean;
    /**
     * Show markdown preview.
     */
    preview?: PreviewType;
    /**
     * Full screen display editor.
     */
    fullscreen?: boolean;
    /**
     * Maximum drag height. `visiableDragbar=true`
     */
    maxHeight?: number;
    /**
     * Minimum drag height. `visiableDragbar=true`
     */
    minHeight?: number;
    /**
     * This is reset [react-markdown](https://github.com/rexxars/react-markdown) settings.
     */
    previewOptions?: Omit<MarkdownPreviewProps, 'source'>;
    /**
     * Set the `textarea` related props.
     */
    textareaProps?: ITextAreaProps;
    /** Use div to replace TextArea or re-render TextArea */
    renderTextarea?: ITextAreaProps['renderTextarea'];
    /**
     * Disable editing area code highlighting. The value is `false`, which increases the editing speed.
     * @default true
     */
    highlightEnable?: boolean;
    /**
     * The number of characters to insert when pressing tab key.
     * Default `2` spaces.
     */
    tabSize?: number;
    /**
     * You can create your own commands or reuse existing commands.
     */
    commands?: ICommand[];
    /**
     * You can create your own commands or reuse existing commands.
     */
    extraCommands?: ICommand[];
    /**
     * Hide the tool bar
     */
    hideToolbar?: boolean;
    /** Whether to enable scrolling */
    enableScroll?: boolean;
}
@goudanz goudanz closed this as completed Sep 27, 2021
@Alexva397
Copy link

@goudanz did you find a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants