Value of field doesn't change if the field type is itemtype and have onchange event.

My scenario is after selecting any value in field 'A' which is of item type, I have to set/change the value of field 'B'. so i added a onchange event in field 'A'. like this

        const inputValue = this.value;

        window.handleItemChange('field B name', "new value" );

        return ;

so what is happening is.

1. when i select value in field A for first time. it work as expected.

2. when i change the value in field A again to different value, the value of field B changes to the new one as expected. but the value in field A does not change and remain the old one.