I'm trying to use the TextField component from Fabric React. It works ok, but clearly the version bundled with SPFx 1.5.1 is a number of versions back. @juliemturner tells me it is 5.83, while the current version of Fabric React is 6.49.2.
We ought to be able to use the onChange event, but it doesn't fire. The onChanged event does fire, however, though it is deprecated.
The newer onChange event passes the event and the value, so we can use it with multiple TextField elements, which is preferable.
The onChange event be.low never fires.
<div className="docs-TextFieldExample">
<TextField
name="matterSearch"
prefix={ this.props.matterContext }
onChange={ this._onTextfieldChange }
value={ this.state.matterSearch}
/>
</div>
the onChanged even below does fire.
<div className="docs-TextFieldExample">
<TextField
name="matterSearch"
prefix={ this.props.matterContext }
onChanged={ this._onTextfieldChange }
value={ this.state.matterSearch}
/>
</div>
Since it's difficult to tie the version of @microsoft/sp-office-ui-fabric-core to the version of @microsoft/office-ui-fabric-core (no sp-), and the Fabric React docs give no indication of when methods or properties have changed, it feels like SPFx is broken. This kind of thing causes friction and a loss of faith in the product. That is a bad dev UX, which I consider a bug. I'm hoping the bundled version
"@microsoft/sp-office-ui-fabric-core": "1.5.1",
for 1.6.0 is closer to current.
Thanks for your contribution! Sharing is caring.
Hi sympmarc, we will report to production team and ask for feedback about update roadmap for "@microsoft/sp-office-ui-fabric-core" . As my understanding, Microsoft usually update module as a bundle. So best to keep to default version of your module until next release.
Meanwhile you are more than welcome to provide your feedback in Microsoft Uservoice channel. Which is the quick router for developer to get feedback.
This issue also wasted some of my time. I found the documentation is unclear. I found the onChange has been fixed in the latest build Fabric React 6.x.x but SPFx 1.6 is not working with 6.x.x version yet (I updated to the latest version to test but later had to downgrade). The following two issues explain the core problem:
https://github.com/OfficeDev/office-ui-fabric-react/pull/5764
https://github.com/OfficeDev/office-ui-fabric-react/issues/6126
For the current solution I am building, I also need the onChange event and might have to use native HTML .
This is a timing and versioning challenge between the packages. Office UI Fabric react is already supporting React 16 and SPFx with SP UIs have not yet been updated to React 16 version. This means that you cannot use the Fabric 6 version yet. Unfortunate timing, but... we are working internally on trying to do a better job on the versioning. Feedback noted, but there's nothing we can do for this now.
I totally get what the issue is, but since we're suggesting people use Office UI Fabric and some things simply don't work due to the version mismatch, the "broken" might stick to SPFx, where it shouldn't.
I'd love to see documentation versioned right along with the code - for Fabric as well as SPFx. The way AngularJS give a link for the errors is awesome, too. Heading in those directions would make SPFx more robust and usable.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
This is a timing and versioning challenge between the packages. Office UI Fabric react is already supporting React 16 and SPFx with SP UIs have not yet been updated to React 16 version. This means that you cannot use the Fabric 6 version yet. Unfortunate timing, but... we are working internally on trying to do a better job on the versioning. Feedback noted, but there's nothing we can do for this now.