FluentUIEditableDetailsList icon indicating copy to clipboard operation
FluentUIEditableDetailsList copied to clipboard

Text selection

Open David-Rousselle opened this issue 4 years ago • 6 comments

Hello,

When I want to edit a text in a textbox, it's drawing a rectangle and doesn't select the text. Here is an example: image

Any idea why ?

I have another question, I use the Picker for the autocomplete. My problem is that by default it only searches in the beginning of the text (like "startswith"), not in whole string. To change this I want to use the callback named onResolveSuggestions. Is it possible ? Do I have access to it ?

Thanks !

David-Rousselle avatar Mar 03 '22 03:03 David-Rousselle

as I don't have access to onResolveSuggestions of the Picker, I tried to use the onRender of the column to display my picker. It works but I can't detect if I'm in edit mode, so the picker is there even if only in display mode. How can i get the edit mode of the row ? Thanks

David-Rousselle avatar Mar 03 '22 21:03 David-Rousselle

Hi @David-Rousselle Please you can take the latest version (1.11.0) that has enhanced feature for Picker Suggestions. It can now support string rules like 'STARTSWITH', 'CONTAINS', 'EQUALTO' etc. This way you can choose to define the rule based on which you want picker suggestions. You just need to upgrade the package and add 'suggestionsRule: StringOperators.STARTSWITH' (or any other rule) in you grid configuration and this should work fine and unblock you. You can also refer to the ReadMe or GridConfig.tsx of the PR https://github.com/microsoft/FluentUIEditableDetailsList/pull/102 to see the fix. As for the textbox selection, let me get back to you with a fix or further details about the behaviour.

Let me know if the picker fix works for you.

kushalmehrotra713 avatar Mar 05 '22 08:03 kushalmehrotra713

Hello @kushalmehrotra713 ,

You forgot to update the definition of IColumnConfig I think, I added it to test. It's not working, "contains" works like "startswith". I think I updated the package correctly.

Also, After asking the possibility to search in whole string with "contains" in my first post, I realized that it won't be enough for me. It's ok for the first picker "project", but I want to do something "cascading". Once I choose my project in the picker, I want the picker in the Task column to have it's pickerTags updated with some info I would get with REST. I then need to have the possibility to access the picker of the task column to update the pickerTags when the project is selected. Or, to control the suggestions dynamically when the user begins to type something in the task picker, with onResolveSuggestions for example.

Thanks a lot for your time.

David-Rousselle avatar Mar 07 '22 16:03 David-Rousselle

Hi @David-Rousselle IColumnConfig was updated in the PR that I checked in earlier. You can find the same in columnconfigtype.tsx in the PR https://github.com/microsoft/FluentUIEditableDetailsList/pull/102/files Also, I have tested the package and it seems to be working fine with the suggestionsRule. As for "contains" functionality, "startswith" is always going to be a subset of "contains" functionality. In other words, any rule condition that is true for "startswith" is always going to be true for "contains" as well.

Now coming to the part where you are looking for cascading functionality. In the current grid implementation, its does not provide that support for pickers and dropdowns, but it can be achieved for controls like textbox, multiline textfields etc. However, I think its a valid ask. So let me see if I can achieve that in the grid in a holistic manner and not constrain it to a single use case. As you mentioned, allowing custom implementation for onResolveSuggestions can be one way to achieve that. Let me try spinning something up on that in a couple of days if thats ok.

kushalmehrotra713 avatar Mar 07 '22 18:03 kushalmehrotra713

Ok I put it in column config and not in picker options... I wasn't wide awake >< It works very well, thanks

thank you for considering my ask !

David-Rousselle avatar Mar 07 '22 19:03 David-Rousselle

Hello @kushalmehrotra713 Any updates on the text selection issue? I believe it is caused by a MarqueeSelection component that you're using. I tried removing it and the text selection seemed to work again though im not sure if it breaks anything else or why exactly its being used in the first place.

A fix for this issue would be highly appreciated.

GoldLudie avatar Nov 22 '22 13:11 GoldLudie