Skip to content

Bug fix: incorrect oldValue in InputFieldInitializer - #1129

Open
happyhua wants to merge 1 commit into
DominoKit:developmentfrom
datalint:feature/input-field-old-value-not-updated
Open

Bug fix: incorrect oldValue in InputFieldInitializer#1129
happyhua wants to merge 1 commit into
DominoKit:developmentfrom
datalint:feature/input-field-old-value-not-updated

Conversation

@happyhua

Copy link
Copy Markdown
Contributor

When setValue (with either silent = true or false) is called on a formElement, the oldValue in InputFieldInitializer is not updated correctly. This can later lead to an incorrect oldValue being passed to formElement.triggerChangeListeners.

        TextBox box = new TextBox();

        box.withValue("Start");

        box.addChangeListener((oldValue, newValue) -> {
            // Expected oldValue is "Start", but the current code returns null/empty.
            DomGlobal.console.log(oldValue + ", " + newValue);
        });

        Domino.body().appendChild(box);

When setValue (with either silent = true or false) is called on a formElement, the oldValue in InputFieldInitializer is not updated correctly. This can later lead to an incorrect oldValue being passed to formElement.triggerChangeListeners.
@vegegoku

Copy link
Copy Markdown
Member

I could not reproduce this, If you can please provide a reproducer that would be a great help.

@happyhua

Copy link
Copy Markdown
Contributor Author

You can use https://github.com/happyhua/demo

I’m missing the previous value 'Start' in the popup.

image

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.

2 participants