Skip to content

iOS: address rawValue uses an arbitrary address component #27

Open

Description

@developerjamiu
// ios/smart_text_flutter/Sources/smart_text_flutter/NSDataDetectorExtension.swift:82
guard let address = match.addressComponents?.values.first else { return nil }

addressComponents is a dictionary, so .values.first returns an arbitrary component with no defined ordering. Tapping "36 Lagos Street, Lagos" can open Maps searching for just "Lagos", and which component you get may vary between runs.

Android already does the right thing at TextClassifier.kt:99 by using the matched text.

Note also that addressComponents is deprecated in favour of components.

Fix: use the matched linkText as rawValue, matching Android. Exposing the structured components as a separate field is tracked separately.

Found during the v0.4.0 codebase audit.

Activity

  1. added
    bug
    platform: ios
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatform: ios

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions