sstur / react-rte

Pure React rich text WYSIWYG editor based on draft-js.
https://react-rte.org
ISC License
2.86k stars 428 forks source link

Link buttons classes are not applied #208

Open tiberiumaxim opened 7 years ago

tiberiumaxim commented 7 years ago

This is my config object. The rendered html shows the classes for the other buttons but not for the link buttons. Neither the labels are inserted, so pretty much the LINK_BUTTONS config is not working actually.

    {
        display: [
            'INLINE_STYLE_BUTTONS',
            'BLOCK_TYPE_BUTTONS',
            'LINK_BUTTONS'
        ],
        INLINE_STYLE_BUTTONS: [
            {label: 'Bold', style: 'BOLD', className: 'rte-button rte-button-bold'},
            {label: 'Italic', style: 'ITALIC', className: 'rte-button rte-button-italic'},
            {label: 'Underline', style: 'UNDERLINE', className: 'rte-button rte-button-underline'}
        ],
        BLOCK_TYPE_BUTTONS: [
            {label: 'Unordered list', style: 'unordered-list-item', className: 'rte-button rte-button-list-unordered'},
            {label: 'Ordered list', style: 'ordered-list-item', className: 'rte-button rte-button-list-ordered'}
        ],
        LINK_BUTTONS: [
            {label: 'Link!', style: 'unstyled', className: 'rte-button rte-button-link'},
            {label: 'Remove link', style: 'unstyled', className: 'rte-button rte-button-link-remove'}
        ]
    }
sandorvasas commented 6 years ago
youpiwaza commented 6 years ago

The style properties seems to allow acces to stuff. Managed to found some with random tests (class names inspect)

INLINE_STYLE_BUTTONS > style: 'STRIKETHROUGH' 
BLOCK_TYPE_BUTTONS > style: 'blockquote'
BLOCK_TYPE_DROPDOWN > style: 'unstyled' },
    { label: 'Large',         style: 'header-one' },
    { label: 'Medium',         style: 'header-two' },
    { label: 'Small',         style: 'header-three' 

Can't figure out what are the keywords for buttons relative to LINK_BUTTONS & HISTORY_BUTTONS..