Skip to content

Unable to open a page with FormattedText on iOS #1772

Closed

Description

@vchimev

The page below is unable to open with 1.7.0 on iOS:

<Page>
    <StackLayout>

      <Label text="labelLabel" style="text-transform: uppercase; text-decoration: underline line-through;" />
      <Label style="text-transform: uppercase; text-decoration: underline line-through;">
        <Label.formattedText>
          <FormattedString>
            <FormattedString.spans>
              <Span text="label" fontAttributes="Bold" foregroundColor="#0000ff" />
              <Span text="Label" fontAttributes="Italic" foregroundColor="#00ff00" />
            </FormattedString.spans>
          </FormattedString>
        </Label.formattedText>
      </Label>

    </StackLayout>
</Page>

Activity

  1. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Mar 16, 2016
  2. added this to the milestone on Mar 16, 2016
  3. vchimev commented on Mar 16, 2016

    @vchimev
    ContributorAuthor

    Fixed by #1771.

  4. vchimev commented on Mar 17, 2016

    @vchimev
    ContributorAuthor

    If start writing into the TextField on the page below, the app crashes at the second entered character.

    <Page>
        <StackLayout>
    
        <TextField style="text-transform: uppercase; text-decoration: underline line-through;">
            <TextField.formattedText>
              <FormattedString>
                <FormattedString.spans>
                  <Span text="text" fontAttributes="Bold" foregroundColor="#0000ff" />
                  <Span text="Field" fontAttributes="Italic" foregroundColor="#00ff00" />
                </FormattedString.spans>
              </FormattedString>
            </TextField.formattedText>
          </TextField>
    
        </StackLayout>
    </Page>

    Output:

    Mar 17 18:56:58 mcsofvchimev.bedford.progress.com TestApp[23454]: *** JavaScript call stack:
    
    (
    0   stringByReplacingCharactersInRangeWithString@[native code]
    1   textFieldShouldChangeCharactersInRangeReplacementString@file:///app/tns_modules/ui/text-field/text-field.js:66:127
    2   UIApplicationMain@[native code]
    3   start@file:///app/tns_modules/application/application.js:222:26
    4   anonymous@file:///app/app.js:61:18
    5   evaluate@[native code]
    6   moduleEvaluation@:1:11
    7   @:8:48
    8   promiseReactionJob@:1:11
    )
    Mar 17 18:56:58 mcsofvchimev.bedford.progress.com TestApp[23454]: *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds'
    *** First throw call stack:
    (
    0   CoreFoundation                      0x02e9b946 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x02b26a97 objc_exception_throw + 44
    2   CoreFoundation                      0x02e9b86d +[NSException raise:format:] + 141
    3   CoreFoundation                      0x02e680d3 mutateError + 259
    4   CoreFoundation                      0x02daaee8 -[__NSCFString replaceCharactersInRange:withString:] + 56
    5   Foundation                          0x0118bc0f -[NSString stringByReplacingCharactersInRange:withString:] + 158
    6   TestApp                             0x007d34d8 ffi_call_i386 + 24
    )
    
  5. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Mar 17, 2016
  6. hamorphis commented on Mar 18, 2016

    @hamorphis
    Contributor

    @vchimev Created a new issue for the problem above: #1792

  7. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  8. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions