danielsaidi / RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
MIT License
944 stars 126 forks source link

The RichTextFont.ListPicker with selection Context.fontName is incorrect #212

Open chanhdatng opened 1 week ago

chanhdatng commented 1 week ago

After pick a font from RichTextFont ListPicker and type some text, open the list picker again and the selection is wrong because the fontName was changed with the context.

Example: Pick font -> San Franscico -> FontName : .SFUI

After edit context, the font now is TimesNewRonamPSMT so when open the list again, the font selection init from fontName 'TimesNewRonamPSMT' is not in the list. (it must be .SFUI)

danielsaidi commented 1 week ago

Hi @chanhdatng

Thank you for reporting. The font handling needs some work!

chanhdatng commented 1 week ago

image Yeah, i found it the list is showing PickerFont init from UIFont.familyNames. Actually when context change, it selected the first font of those FamilyNames.

Hope this will be fixed <3 and add animation scroll to selected font if moveSelectionTopmost is false