Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@lei9444
Copy link
Contributor

@lei9444 lei9444 commented Sep 17, 2020

Description

Root Cause

Our simplified component structure is like
L1: TextField's parent (property editor and\or it's parent)
L2: TextField (hold a local state, uncontrolled value)
L3: Native browser's input which also have a value

A normal workflow is L3's state get changed and propagated to L2 and L2 use local state to set value again to L3, and it's synced.
In our case, L1 component is re-rendered occasionally, which is causing L2 to re-render also, and if it's timing is just at the time L3's value is changed but not being propagated to L2 yet. the changes in L3 will lost and will be override by L2's local state and cursor is moved to the end.

Solution

The first step is a quick fix for this type issue: we fork the TextField component from FluentUI and replace the uncontrolled logic with defaultValue of the native .

For further plan: we need to avoid elements over rendering

Task Item

closes #4102

Screenshots

@coveralls
Copy link

coveralls commented Sep 17, 2020

Coverage Status

Coverage decreased (-0.05%) to 55.4% when pulling 1587554 on lei9444:text into 59f4649 on microsoft:main.

@LouisEugeneMSFT
Copy link
Contributor

LouisEugeneMSFT commented Sep 18, 2020

I am curious, is there a specific reason for wanting to replicate all of Fabric textfield functionalities? Since we are rebuilding the component from scratch, it is our opportunity to add only what we need.

My opinion would be to keep a streamlined input field, like the initial prototypes and make it visually similar to Fabric textfield. In the meantime we can convince Fabric team to update their component / PR against their repo.

The challenge with this PR is that since we are importing all the interfaces from office-ui-fabric-react/lib but then re-hardcoding the entire component in Composer, a bump in dependency version would make us diverge more from the TextField offered by the library. Additionally, it is also hard to know what is copied over and what is "ours".

@a-b-r-o-w-n
Copy link
Contributor

@LouisEugeneMSFT can you look at this again today?

Copy link
Contributor

@LouisEugeneMSFT LouisEugeneMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
@a-b-r-o-w-n , any other comments?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing too fast in composer results in dropped characters

7 participants