Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27893] Android: Setting views to "opacity: 0.0" does still trigger touch events (parity)

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2020-05-08T19:10:35.000+0000
Updated2020-06-22T19:59:20.000+0000

Description

On Android, setting views to myView.opacity = 0.0 still triggers the touch events of the view(s) that are hidden. This does not happen for iOS and is a parity issue on Android as views that are hidden should really be hidden completely.

Comments

  1. Michael Gangolf 2020-05-08

  2. Michael Gangolf 2020-05-08

    Possible PR: https://github.com/appcelerator/titanium_mobile/pull/11695 only the visible view is returning touch events. Invisible OR touchEnabled(false) view never returns touch events. There might be an easier solution but it works :)
  3. Joshua Quick 2020-06-20

    There is actually a practical use-case for having a transparent view to steal touch events. I've done this when creating my own custom dialogs (and overlays too). When doing this, you actually want an invisible view to fully fill the screen to steal touches around the dialog. That way, touching outside the dialog can be used to either dismiss the dialog or do nothing to force the end-user to make a selection. I think the way Android is doing it is correct. I know Windows Phone worked this way too (I've implemented a custom dialog as described above). If you don't want the invisible view to accept touches, then it's "touchEnabled" property should be set false.
  4. Michael Gangolf 2020-06-20

  5. Joshua Quick 2020-06-22

    Yes, [TIMOB-26581] needs to be solved. I agree. If resolving that ticket will solve the issue for you, then I'd rather we tackle that ticket.

JSON Source