Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by adam_dicker · Mar 11, 2015 at 11:04 AM · uieventeventsystem

Unity UI: How to stop select event from propagating?

I am trying to achieve a menu list with scroll up / down buttons.

The issue I am having is that when the scroll buttons are clicked, the focus is taken

from the selected menu item and given to the scroll button that was clicked,

while I want the menu item that was selected to retain focus.

I can save the previously selected menu item and re-select it, but this causes the select event

and thus the select animation to fire again, which is not ideal.

So I was wondering if it is possible to stop the select event from firing on the selected

item, but not propagate to the event system?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image miracalious · Apr 15, 2015 at 07:21 AM 0
Share

I am also wondering how to do this since I am trying to create a "Load Game" menu with a series of selectable objects in a scrollable list. If anyone can figure out how to prevent the deselection of UI objects before a button's onclick event is triggered please post here.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by The_Immovable · Oct 07, 2015 at 07:02 PM

We have encountered 2 solutions:

1.-You have to OVERRIDE the OnPointerDown event on the InputField, and changing its behavior to OnClick event, so you have to make OnClick equal to OnPointerDown and erase OnPointerDown behavior.

2.-You can trigger the InputField keyboard implicitly so you can position a transparent UI Button over the InputField and make this button call the InputField OnPointerDown handler with ExecuteEvents class

BTW number one is easier, you just need to create a Script that inherit InputField and change the events.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I stop EventSystem.currentSelectedGameObject from changing on a button press 0 Answers

Broadcast mouse event on Canvas 0 Answers

How to add callback for button press to a private function (New UI)? 1 Answer

EventSystem not recognizing child objects 0 Answers

Hide/show UI Button and trigger the OnPointerDown event ?! 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges