Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Child view click events are not fired, if eventlistener is not attached at creation time #13936

Open
1 task done
jonasfunk opened this issue Oct 16, 2023 · 0 comments
Open
1 task done
Labels
bug ios needs triage This issue hasn't been reviewed by maintainers

Comments

@jonasfunk
Copy link

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

Attaching a click eventlistener with a delay to a parent view will only register events on its direct children.
Setting the extendSafeArea on window will mess things even more up. Then no events are fired.

Expected Behavior

Attaching a click eventlistener with a delay to a parent view should register events on all its children and subchildren.

Actual behavior

Attaching a click eventlistener with a delay to a parent view will only register events on its direct children.

Reproducible sample


//Will only trigger events on direct children. 
setTimeout(() =>
{
	$.window.addEventListener('click', onClick);
}, 10);

//Will trigger event on children its subChildren
//$.window.addEventListener('click', onClick);

function onClick(e)
{
	console.debug("Click from eventlistener", e.source.id);
}


$.window.open();


//View 
<Alloy>
	<Window id="window">
		<View id="view1" height="200" width="200" backgroundColor="red">
			<View id="subview" height="100" width="100" backgroundColor="yellow"/>
		</View>
	</Window>
</Alloy>

Steps to reproduce

Run the code and try clicking on the yellow square. No event is registered.

Platform

iOS

SDK version you are using

12.2.0.GA

Alloy version you are using

2.0.2

@jonasfunk jonasfunk added bug needs triage This issue hasn't been reviewed by maintainers labels Oct 16, 2023
@m1ga m1ga added the ios label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ios needs triage This issue hasn't been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants