Our blazing fast Grid component built with pure JavaScript


Post by muhammad faisal »

When using a time column with finalizeCellEdit in Grid 6.2.0, the error state incorrectly persists even after entering a valid time value. This issue specifically occurs in the following scenario:

  • User attempts to set a time in the past, triggering validation error

  • User then tries to set a valid future time

  • The error state remains active despite the valid input

This behavior is not present in Grid 6.0.3

Steps to reproduce:

  • Open the grid example

  • Copy paste attached code

import { Grid, Toast, DataGenerator } from '../../build/grid.module.js?484519';

const grid = new Grid({
    appendTo : 'container',
    data: [
        { id: 1, name: 'Task 1', description: 'First task', alertTime: new Date(), status: 'Active' },
        { id: 2, name: 'Task 2', description: 'Second task', alertTime: new Date(), status: 'Pending' }
    ],

columns: [
    { 
        field: 'name', 
        text: 'Name',
        width: 150 
    },
    { 
        field: 'description', 
        text: 'Description',
        flex: 1 
    },
    {
        type: 'time',
        field: 'alertTime',
        text: 'Alert Time',
        width: 120,
        editor: {
            type: 'time',
            keepDate: true
        },
        finalizeCellEdit: ({ value }) => {
            const currentTime = new Date();
            const selectedTime = new Date(value);
            
            // Set seconds and milliseconds to 0 for accurate comparison
            currentTime.setSeconds(0, 0);
            selectedTime.setSeconds(0, 0);
            
            if (selectedTime < currentTime) {
                return 'Cannot set time in the past';
            }
            return true;
        }
    },
    { 
        field: 'status', 
        text: 'Status',
        width: 100 
    }
],

});
  • Set time to a past value (validation error appears)

  • Attempt to set time to a future value

  • Observe that error state remains despite valid input

Expected behavior: Error state should clear when a valid time value is entered.
Actual behavior: Error state persists even after entering valid time value.

Attached is video for reference.

Attachments
Record 2025-04-15 152120 (1).mp4
(3.11 MiB) Downloaded 1 time

Post by alex.l »

Hi,

Thank you for clear test case, I've opened a ticket here https://github.com/bryntum/support/issues/11132
You can subscribe on ticket updates to be notified when it's done.

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post by muhammad faisal »

Thanks


Post Reply