Code Monkey home page Code Monkey logo

Comments (8)

jamesbebbington avatar jamesbebbington commented on May 23, 2024

Ah, it looks like the iOS Accessibility Programming Guide explains (inc. sample code) how to make the contents of custom container views accessible. Unfortunately we don't have any Obj-C expertise in-house to try out this implementation.

from phfcomposebarview.

fphilipe avatar fphilipe commented on May 23, 2024

Hey @jamesbebbington. Sorry, but I don't have the capacity to implement this change.

from phfcomposebarview.

fphilipe avatar fphilipe commented on May 23, 2024

Hey @jamesbebbington, I've looked a bit into this and the UIAccessibilityContainer protocol. I changed the container that contains the text view from a button to a normal view. Would you mind testing with the improve-accessibility branch, specifically this commit? 28a3b5c

Thanks!

from phfcomposebarview.

jamesbebbington avatar jamesbebbington commented on May 23, 2024

Thanks @fphilipe, much appreciated.

UI tests can now address the text view, however I'm seeing some strange behaviour when programatically entering text. Given this UI Test case:

import XCTest

class PHFComposeBarViewExampleUITests: XCTestCase {

    override func setUp() {
        super.setUp()
        continueAfterFailure = false
    }

    func testComposeBar() {
        let app = XCUIApplication()
        app.launch()

        app.staticTexts["PHFComposeBarPlaceholderLabel"].tap()
        app.textViews["PHFComposeBarTextView"].typeText("Here is some sample text. It's a few lines long but not too long. I think that should do it.")
        app.buttons["PHFComposeBarUtilityButton"].tap()
        sleep(5)
    }

}

the entered text is being partially erased as it's entered:

Oh and a default accessibility identifier for the placeholder label would be helpful, so it's easier to address in tests when the app is localised.

EDIT: I forgot that I had set the accessibility identifiers in the the example app. Test code above updated and pushed in new ui-tests-2 branch.

Thanks!

from phfcomposebarview.

jamesbebbington avatar jamesbebbington commented on May 23, 2024

I've pushed a couple of updates to the ui-tests-2 branch, fixing the misnamed buttons and adding a (failing) assert that checks that the entered message was properly saved.

from phfcomposebarview.

fphilipe avatar fphilipe commented on May 23, 2024

@jamesbebbington thanks! I've added a commit introducing a test (based on yours). I was not able to reproduce your erasing text problem you showed in the GIF.

I'm wondering if the accessibility identifiers should be set directly in PHFComposeBarView or if it should be up to the consumer of it to set it (as you did and I've taken over).

From my side this would be ready. Let me know if this works for you.

from phfcomposebarview.

jamesbebbington avatar jamesbebbington commented on May 23, 2024

Cheers @fphilipe, will take a look now.

I'm wondering if the accessibility identifiers should be set directly in PHFComposeBarView or if it should be up to the consumer of it to set it (as you did and I've taken over).

I don't think it matters too much either way, as long as consumers can set them. I think it's probably fine to leave them unset, as I'd imagine anyone who wanted to use them would want to rename them anyway.

from phfcomposebarview.

jamesbebbington avatar jamesbebbington commented on May 23, 2024

I was not able to reproduce your erasing text problem you showed in the GIF.

Yeah, it's an odd one, it seems a bit intermittent.

I integrated the improve-accessibility branch into our app and ran tests on iPhone 4s, 5, 6 & 6 Plus across four different languages and they were all fine, so not really sure what's going on with that.

Let me know if this works for you.

Yup, many thanks @fphilipe!

from phfcomposebarview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.