Skip to content

[RFR] [BC break] Easier custom toolbar - #2340

Merged
djhi merged 3 commits into
nextfrom
easier-custom-toolbar
Sep 19, 2018
Merged

djhi merged 3 commits into
nextfrom
easier-custom-toolbar

Conversation

@fzaninotto

Copy link
Copy Markdown
Member

Problem

Removing the delete button from the Edit toolbar used to require to create a Toolbar component from scratch.

Refs #2319

Solution

With this PR, it's as easy as passing just the <SaveButton> as only child of a custom <Toolbar>:

const PostEditToolbar = props => (
    <Toolbar {...props} >
        <SaveButton />
    </Toolbar>
);

export const PostEdit = (props) => (
    <Edit {...props}>
        <SimpleForm toolbar={<PostEditToolbar />}>
            ...
        </SimpleForm>
    </Edit>

There is a slight BC break here: people with custom Toolbar for Edit views used to have the Delete button displayed even though it wasn't in their custom toolbar. With that change, the Edit button will disappear. I think, with proper warning in the release notes, we can assume this BC break (on a feature that is very young and probably not very widely used to date).

@fzaninotto fzaninotto added this to the 2.4.0 milestone Sep 19, 2018
@palyvodaBoi

Copy link
Copy Markdown

bad solution (as usual)
Save button loses its 'disabled' functionality with custom toolbar

I can believe it's hard to add 'showDeleteButton' property

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

Successfully merging this pull request may close these issues.

3 participants