ProMotion icon indicating copy to clipboard operation
ProMotion copied to clipboard

editing_style: :none not working properly with VoiceOver

Open jamonholmgren opened this issue 10 years ago • 9 comments

Per @austinseraphin's tweet: https://twitter.com/AustinSeraphin/status/582650809772568576

In table_data I specify editing_style: :none but VoiceOver still says Swipe to delete. What have I missed? VoiceOver offers the delete action on PM’s table screen cells by default.

jamonholmgren avatar Mar 31 '15 01:03 jamonholmgren

The problem happens because of the existence of the tableView:commitEditingStyle:forRowAtIndexPath: method. As long as it exists VoiceOver will falsely report the cell as deletable. Some metaprogramming might fix this. Oh.. except RubyMotion doesn't have define_method. Oh dear... Well there goes that idea.

austinseraphin avatar Mar 31 '15 03:03 austinseraphin

We could extend the TableScreen instance with a module, something like this:

module ProMotion::Table::Deletable
  def tableView:commitEditingStyle:forRowAtIndexPath:  # <  i know this is wrong, in a hurry
  end
end

...

screen.extend(PM::Table::Deletable) if @deletable # whatever

jamonholmgren avatar Mar 31 '15 18:03 jamonholmgren

Ah yes, much simpler. Yes, include the module if the table has any cells with an editing style of delete or insert.

austinseraphin avatar Mar 31 '15 18:03 austinseraphin

Please see pull request #678

austinseraphin avatar Apr 27 '15 19:04 austinseraphin

:+1:

squidpunch avatar Apr 27 '15 20:04 squidpunch

As per #690, including the tableView:commitEditingStyle:forRowAtIndexPath: in a extended module breaks actual deleting functionality. I'm pretty sure that it has to be included in the class when the class is loaded and not included modularly in order for the table cells to actually be deletable.

markrickert avatar May 14 '15 16:05 markrickert

Based on https://gist.github.com/d-ronnqvist/3584ccf3379f9c318e4f I think i may have found a valid solution to this. @austinseraphin can you please check out the branch bug/690-edit-table and let me know if this works with accessibility?

markrickert avatar May 14 '15 16:05 markrickert

Yes this works.

austinseraphin avatar May 14 '15 18:05 austinseraphin

Perhaps unrelated, when I have the editing style set to insert it still says swipe to delete. I don’t know if this happens because of a VoiceOver bug or a bug in ProMotion. I’ll dig a little. But for now the regular cells don’t report any actions, the original point of this bug report.

On May 14, 2015, at 12:28 PM, Mark Rickert [email protected] wrote:

Based on https://gist.github.com/d-ronnqvist/3584ccf3379f9c318e4f https://gist.github.com/d-ronnqvist/3584ccf3379f9c318e4f I think i may have found a valid solution to this. @austinseraphin https://github.com/austinseraphin can you please check out the branch bug/690-edit-table and let me know if this works with accessibility?

— Reply to this email directly or view it on GitHub https://github.com/clearsightstudio/ProMotion/issues/653#issuecomment-102094176.

austinseraphin avatar May 14 '15 20:05 austinseraphin