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

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

Merged
merged 3 commits into from
Sep 19, 2018
Merged

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

merged 3 commits into from
Sep 19, 2018

Conversation

fzaninotto
Copy link
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

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