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

isCreating flag gets "stuck" if the edit is vetoed #7224

Closed
taauntik opened this issue Jul 27, 2023 · 1 comment
Closed

isCreating flag gets "stuck" if the edit is vetoed #7224

taauntik opened this issue Jul 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@taauntik
Copy link

Forum post

I am using the Calendar component in List mode view.

We create events using an external button/editor.

If the new event is not going to be saved, we call the "remove" method on the event object. But this doesn't remove the event from the list.

Note: Try adding multiple events one by another and then click remove. In this case works

You can test it by going to below example and paste the code below in the editor

click on add button
click on remove button (I expect the event to be removed from the list)

https://bryntum.com/products/calendar/examples/listview/

import {Calendar} from '../../build/calendar.module.js?469544';

// this will store the newly created event
let new_event = null;

const calendar = new Calendar({
    appendTo: 'container',
    mode: 'list',
    modes: {
        list: {}
    },
    listeners: {
        beforeEventEdit({eventRecord}) {
            new_event = eventRecord;

        // here we open our custom editor which will recevie the "new_event" as a prop

        // prevent built in editor
        return false;
    },
}
});

const add_button = document.createElement('button');
add_button.id = 'add-button';
add_button.innerText = 'Add';

const remove_button = document.createElement('button');
remove_button.id = 'remove-button';
remove_button.innerText = 'Remove';

document.querySelector('#container').appendChild(add_button);
document.querySelector('#container').appendChild(remove_button);

document.getElementById('add-button').addEventListener('click', function () {
    calendar.createEvent(calendar.date);
});

document.getElementById('remove-button').addEventListener('click', function () {
    console.log(new_event);

if (new_event) {
    new_event.remove()
    new_event = null;
}
});


To reproduce

  1. open the example
  2. paste the code I provided
  3. [Important!]Click on Add button (this creates new event and is displayed on the list)
  4. Click on Remove button (the event stays there, when it should be deleted from the list)

Note: also doesn't work with eventStore.remove(record)

@taauntik taauntik added bug Something isn't working forum Issues from forum labels Jul 27, 2023
@taauntik taauntik changed the title event.remove() doesn't remove event in eventList isCreating flag gets "stuck" if the edit is vetoed Jul 28, 2023
@matsbryntse matsbryntse added the ready for review Issue is fixed, the pull request is being reviewed label Jul 29, 2023
@matsbryntse matsbryntse self-assigned this Jul 29, 2023
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Jul 30, 2023
@isglass isglass added this to the 5.5.0 milestone Jul 30, 2023
@ExtAnimal
Copy link

ExtAnimal commented Aug 2, 2023

The bug described in the ticket is not fixed. The isCreating flag is still set when creating an event, and the edit is vetoed:

Screenshot 2023-08-02 at 11 15 49

@ExtAnimal ExtAnimal reopened this Aug 2, 2023
@ExtAnimal ExtAnimal removed the resolved Fixed but not yet released (available in the nightly builds) label Aug 2, 2023
@matsbryntse matsbryntse added resolved Fixed but not yet released (available in the nightly builds) and removed resolved Fixed but not yet released (available in the nightly builds) labels Aug 2, 2023
@matsbryntse matsbryntse modified the milestones: 5.5.0, 5.5.1 Aug 2, 2023
@kronaemmanuel kronaemmanuel added ready for review Issue is fixed, the pull request is being reviewed and removed BLOCKING labels Aug 8, 2023
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Aug 9, 2023
@isglass isglass assigned kronaemmanuel and unassigned matsbryntse Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

5 participants