sp-dev-fx-property-controls icon indicating copy to clipboard operation
sp-dev-fx-property-controls copied to clipboard

PropertyFieldTextWithCallout resetting cursor everytime a character is typed?

Open spplante opened this issue 2 years ago • 5 comments

Category

  • [ ] Enhancement
  • [x] Bug
  • [ ] Question

Version

3.11.0

Expected / Desired Behavior / Question

When typing in the textbox, the cursor should stay next to the character you just typed

Observed Behavior

Each time you type a character, the cursor resets to the end of the text. When starting from blank and typing a new value you don't notice this because the cursor stays at the end, but if you start typing in the middle of an existing value it keeps resetting the cursor at the end which is extremely confusing for users.

Example: Textbox contains "Test.json" and you want to change it to "TestUpdated.json", you put your cursor right after "Test" and you start typing "Updated", but the value will end up with "TestU.jsondated" because as soon you type "U" the cursor resets to the end of the string... In order to be able to update the value you have to delete it entirely and start typing it from scratch otherwise it's unusable.

The OOTB PropertyPaneTextField does not have this problem

Steps to Reproduce

  • Start a brand new SPFx project using Yoman
  • Replace the default "description" property with the following :
PropertyFieldTextWithCallout('description', {
                  calloutTrigger: CalloutTriggers.Hover,
                  key: 'descriptionFieldId',
                  label: 'Describe your PnP passion with few words',
                  calloutContent: React.createElement('span', {}, 'You can describe your passion with such words as strong, cosmic, all-absorbing, etc.'),
                  calloutWidth: 150,
                  value: this.properties.description
                })

spplante avatar Jan 18 '23 15:01 spplante

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jan 18 '23 15:01 ghost

I just rolled back the versions until it worked, and it looks like the last working version was 2.7.0. Looks like the PropertyFieldTextWithCallout was broken in versions 3.0.0 and 3.1.0 where it simply doesn't work (can't update the textbox value at all), then in version 3.2.0 it was partially "fixed" so you can update the value of the textbox, but this is where the cursor reset bug starts.

spplante avatar Jan 18 '23 15:01 spplante

@spplante - I can't repro the issue. Could you please share some test solution where I can try that?

AJIXuMuK avatar Feb 23 '23 02:02 AJIXuMuK

@AJIXuMuK Did you follow the "Steps to reproduce"? You are using version 3.11.0?

spplante avatar Feb 28 '23 18:02 spplante

Still the same problem with a brand new SPFx solution with version 3.15.0, downgrading to 2.7.0 still works.

spplante avatar Nov 30 '23 17:11 spplante