SelectionStart.Offset not right in TextBlock?
the offset of the SelectionStart is not right how to get the startIndex and endIndex?
it is in unicode.
Universal Windows Platform (UWP)
Windows App SDK
-
mc 4,516 Reputation points
2022-10-09T09:39:08.857+00:00 someone help me please?
-
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-10T08:23:12.547+00:00 Could you please be more specific about your question? Please share the code that you are using. Tell us the behavior you are getting now and what is the expected behavior you want to get. This could help us understand you question better.
-
mc 4,516 Reputation points
2022-10-11T12:58:10.2+00:00 please check.
The Offset should be 1 right? but it is 3
-
mc 4,516 Reputation points
2022-10-12T13:24:37.317+00:00 -
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-13T09:27:54.913+00:00 As I mentioned in my last comment, please share the code that you are using. Make sure that the code you shared could reproduce this issue in a blank app. This could help us to reproduce this issue on our side and check this behavior.
-
mc 4,516 Reputation points
2022-10-14T00:47:55.663+00:00 Just place textblock.
<TextBlock Text="罩云飘远岫,喷雨泛长河。低飞昏岭腹,斜足洒岩阿。泫丛珠缔叶,起溜镜图波。濛柳添丝密,含吹织空罗。" SelectionChanged="TextBlock_SelectionChanged" IsTextSelectionEnabled="True" />
add Button to get the selectionStart.Offset.
-
mc 4,516 Reputation points
2022-10-15T09:33:04.593+00:00 -
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-17T08:10:34.803+00:00 I'll need to talk with other engineers about this. There might be some time delay.
-
mc 4,516 Reputation points
2022-10-17T15:15:28.13+00:00 thank you @Roy Li - MSFT
-
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-20T06:54:13.237+00:00 I've reported this issue to the team and ask team to confirm this behavior.
-
mc 4,516 Reputation points
2022-10-21T13:48:15.577+00:00 please give the url.
-
mc 4,516 Reputation points
2022-10-24T00:39:21.487+00:00 where you post it ?can I get the url to get something dicussion?
-
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-24T02:43:09.727+00:00 I'm using our internal channel to report this issue so I can't share more until I got response. But you could report this on the WinUI github as well. The team will also check issues there.
-
mc 4,516 Reputation points
2022-10-26T01:09:31.077+00:00 please give me offer so we are mates.
0.0
-
Roy Li - MSFT 33,276 Reputation points • Microsoft Vendor
2022-10-26T02:23:34.68+00:00 I'm sorry to say that currently there is no more information I could share about this.
-
Viorel 117.6K Reputation points
2022-10-26T08:51:32.87+00:00 I think that your expectations are wrong, probably due to documentation deficiencies.
In case of TextBlock, the offset includes more kinds of symbols. Probably this Remark is applicable for UWP too: https://learn.microsoft.com/en-us/dotnet/api/system.windows.documents.textpointer.getoffsettoposition?view=windowsdesktop-6.0#remarks.
Maybe you can implement the features using the current meaning of offsets.
Sign in to comment