we found a bug in <PROJECT_NAME> - a certain select box does not update the new selection value on click.
Facts:
we are using version 27.5.0
the bug is only in Firefox - chrome and edge works.
I tested your showcase with the same version in Firefox and the showcase is working.
this is the code:
return (
<ActionContentbox className={classFor("delta-create-dialog")}
headingElements={<Heading />} footer={<Footer {...{...this.props, ...this.state}} />}>
<div className={classFor("input-select")}>
<Select label="Deltatyp" value={this.state.variant} onValueChanged={this.handleDeltaTypeChange}>
<Select.Item label={localizer(`p-designer.delta.select.type.standard`)} value={Variant.STANDARD}/>
<Select.Item label={localizer(`p-designer.delta.select.type.exml`)} value={Variant.EXML}/>
</Select>
</div>
<Autocomplete
label={localizer("p-designer.delta.select.version.label")}
items={this.getVersions(this.state.currentAndPreviousData.previous)}
inputPlaceHolder={localizer("p-designer.delta.select.version.hint")}
hintTemplate={""}
onValueChange={value => this.handleVersionChange(value as DropDownItem)}
/>
{
(this.props.activity.processState === "updating") &&
<ProgressIndicator fastAppear={true} label={localizer("p-designer.delta.loading.message")} />
}
</ActionContentbox>
);
this is the link I tested:
<INTERNAL_LINK>
the problematic Select box is in line 4 in the code above
any advice would be appreciated…
Hi iarazi,
doing some investigation into <PROJECT_NAME> code base i come to conclusion the issue is possibly caused by the handling of the mouse event in p-designer container when using the deselectAll action from inside handleClickOutside function.
p-designer.container.tsx :90
that is wonderful - thank you for the help
just one more question - how come it still works on chrome?
i can just guess… but like described in this comment it could be the amount of underlaying events:
opened 03:02PM - 09 Apr 18 UTC
closed 01:11AM - 07 Aug 18 UTC
Component: DOM
Reporting a Bug
**What is the current behavior?**
When selecting a value in … a React controlled select box in Firefox, the selection doesn't change. This occurs when a MouseDown handler also generates a state change.
It seems to occur when the MouseDown handler sets the state and re-renders the dropdown before the onChange event handler fires. The onChange is then triggered with the old select value because React provided the old state during the re-render.
CodePen (modified example from the Docs): https://codepen.io/anon/pen/zWyJqg?editors=0010
Steps to reproduce:
1. Run example on Firefox
2. Open the dropdown and select a different value (e.g. Grapefruit)
3. Observe that the new value is not selected.
**What is the expected behavior?**
Select dropdown is updated and the value is available in React.
**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
Tested on Firefox v59.0.2 (Development Edition and Normal) on OSX using React v16.3.1 and v16.1.1
Also encountered on Windows but I'm not sure of the exact versions.
Tested on Chrome and everything works as intended on OSX and Windows.
super - I was also searching for that and couldn’t find anything - thanks a lot - I know what to do.
cool… it would also be nice if you could add some roughly information what kind of solution then works for you (when tested)
it seems like widgets is not calling stopPropagation - is there a way I can do that easily without implementing a Select of my own?
found a solution -
I changed the mouseDown event to a click Event -
I presume the Select is working on click and not mouseDown and therefore must have a stopPropagation in place which will fix the problem.