ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

Input: OnChange event not triggered after clearing the state

Open guedes4g opened this issue 4 years ago • 3 comments

Describe the bug Input is not calling on change as expected. Read the steps and watch the gif for better understanding:

Isolated Example Forgive me for not using the sanbox. It is currently being blocked by my firewall.

import React, { useState } from 'react';
import { Button, Input } from '@ui5/webcomponents-react'

const App = () => {
  const [value, setState] = useState('');
  const handleChange = (e) => {
    setState(e.target.value);
  }
  return (
    <>
      <Button onClick={() => setState('')}>Clear</Button>
      <Input value={value} onChange={handleChange} />
      <p>{value}</p>
    </>
  );
};

export default App;

To Reproduce Steps to reproduce the behavior:

  1. Have an input field with some value eg. '[email protected]' and copy to your clipboard
  2. Programatically clear the value of the state of that given input field
  3. Paste the value on your clipboard to the field again
  4. See error (value is not updated, onchange is not triggered)

Expected behavior After clearing and pasting the old value I expect the onChange to be triggered again

Screenshots recording

UI5 Web Components for React Information @ui5/webcomponents version: 1.6.0 @ui5/webcomponents-react version: 0.27.1 Operating System: MacOS Browser: Chrome (Version 103.0.5060.134 (Official Build) (x86_64))

guedes4g avatar Aug 04 '22 18:08 guedes4g

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

MarcusNotheis avatar Aug 05 '22 06:08 MarcusNotheis

Should be the same issue as described here.

Lukas742 avatar Aug 05 '22 07:08 Lukas742

Hello Team @SAP/ui5-webcomponents-topic-rl

Issue introduced by latest refactoring of change event. Example: https://jsbin.com/pobagobovo/1/edit?html,console,output

Regards, Martin

MapTo0 avatar Aug 05 '22 12:08 MapTo0