iPhoneNumberField icon indicating copy to clipboard operation
iPhoneNumberField copied to clipboard

cycle detected through attribute

Open realszopen opened this issue 10 months ago • 2 comments

This happens on current release of iPhoneNumberField when trying to edit empty text field with placeholder text in place. It does not happen when editing text field with text already in place.

=== AttributeGraph: cycle detected through attribute 842776 === === AttributeGraph: cycle detected through attribute 580900 === === AttributeGraph: cycle detected through attribute 580900 === === AttributeGraph: cycle detected through attribute 580900 === === AttributeGraph: cycle detected through attribute 580900 ===

realszopen avatar Apr 19 '24 06:04 realszopen

Experiencing this as well. Any updates?

keenan-chiasson avatar Apr 30 '24 18:04 keenan-chiasson

Looks like a fix was merged but a release was never published: https://github.com/MojtabaHs/iPhoneNumberField/pull/76

tonybruess avatar May 03 '24 20:05 tonybruess

That's actually interesting. I used to experience this cycle graph in more situations. Now the number of cases seems actually smaller. Nevertheless, I have downgraded iPhoneNumberField in production app and using old version while waiting for release with fix.

realszopen avatar May 06 '24 12:05 realszopen

I would like to use this package except for these cycle errors. Can we merge the PR that fixes this?

freywaid avatar May 10 '24 18:05 freywaid

@realszopen @tonybruess @keenan-chiasson

Please:

  • Fork the project
  • Add an example view into the demo project - (Think of it as a test case)
  • Name the file as Case-102.swift
  • PR a draft request so I can investigate the root cause, contribute, and merge it back to the package.

This way the final merged code will have a manual test file and your name as a contributer on it 🙌🏻

MojtabaHs avatar May 13 '24 19:05 MojtabaHs

I would like to use this package except for these cycle errors. Can we merge the PR that fixes this?

@freywaid Since I can't reproduce the original issue, you may want to directly use the PR (temporary) in your project until some one is able to make a Test-Case-PR as I described above.

MojtabaHs avatar May 13 '24 19:05 MojtabaHs

Done PR #103

realszopen avatar May 16 '24 08:05 realszopen

I can't reproduce the issue. What I've done:

  • Tap on the empty field - (nothing strange)
  • Tap on the numbers - (nothing strange)
  • Tap on the clear button until it is empty - (nothing strange)
  • Tap on the clear button while it is already empty - (nothing strange)
  • Repeat with adding *, # and + signs - (nothing strange)
  • Tap on the flag - (nothing strange)
  • Select different countries - (nothing strange)

I have done the above steps rotating (like starting from the 4th step to the end and then from step 1 to the 4th) but again, no issues.

Please specify the exact steps to reproduce the issue on the Demo app so we will be on the same page.

ps: you can use the following to make your case run on the demo app as your previewed:

struct MultiplatformDemoApp: App {
    @State var number: String = ""

    var body: some Scene {
        WindowGroup {
            ContentView()
            if #available(iOS 15.0, *) {
                iPhoneNumberFieldTestView(placeholderText: "GOTACHA", mainText: $number)
            }
        }
    }
}

Also, don't forget to pull the necessary changes I've made to your PR first!

MojtabaHs avatar May 18 '24 08:05 MojtabaHs

I appreciate you trying to find the issue without any input from me. The issue arises when I'm using a binding to an optional string:

func ??<T>(lhs: Binding<Optional<T>>, rhs: T) -> Binding<T> {

Binding(

    get: { lhs.wrappedValue ?? rhs },

    set: { lhs.wrappedValue = $0 }

)

}

struct MyView: View {

@Binding var text: String?


var body: some View {

    iPhoneNumberField(text: $text ?? "")

}

}

On Sat, May 18, 2024 at 1:44 AM Seyed Mojtaba Hosseini Zeidabadi < @.***> wrote:

I can't reproduce the issue. What I've done:

  • Tap on the empty field - (nothing strange)
  • Tap on the numbers - (nothing strange)
  • Tap on the clear button until it is empty - (nothing strange)
  • Tap on the clear button while it is already empty - (nothing strange)
  • Repeat with adding *, # and + signs - (nothing strange)
  • Tap on the flag - (nothing strange)
  • Select different countries - (nothing strange)

I have done the above steps rotating (like starting from the 4th step to the end and then from step 1 to the 4th) but again, no issues.

Please specify the exact steps to reproduce the issue on the Demo app so we will be on the same page.

ps: you can use the following to make your case run on the demo app as your previewed:

struct MultiplatformDemoApp: App { @State var number: String = ""

var body: some Scene {
    WindowGroup {
        ContentView()
        if #available(iOS 15.0, *) {
            iPhoneNumberFieldTestView(placeholderText: "GOTACHA", mainText: $number)
        }
    }
}

}

— Reply to this email directly, view it on GitHub https://github.com/MojtabaHs/iPhoneNumberField/issues/102#issuecomment-2118708047, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACY6IC2AAXGFYRAHUYODTWDZC4IGBAVCNFSM6AAAAABGORVEX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYG4YDQMBUG4 . You are receiving this because you were mentioned.Message ID: @.***>

freywaid avatar May 19 '24 18:05 freywaid

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 19 '24 02:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jul 04 '24 02:07 github-actions[bot]