[BUG]: SetFocus() Doesn't Work on Any Creative Kit Controls
Describe the bug
I get an error when I try to SetFocus() to a CreativeKit control. The control is not in a gallery or in another container. It is grouped with other controls, but a group is not a container.
To Reproduce Steps to reproduce the behavior:
- Drop a picker, panel, or other CreativeKit control on a Screen
- Drop a label on the screen
- Group the controls from step 1 and step 2 (This is not necessary, but it is what I have done)
- Drop a button on the same screen
- In the
OnSelect()for the button add aSetFocus()to one of the controls added in step 1 - See error
Expected behavior
No error and the SetFocus() to work
Screenshots
Additional context This works on any regular controls that are in the same place.
Thanks for the great suggestion. SetFocus() requires additional work that was not initially scoped. I will validate whether SetFocus is supported for components.
Were you able to try out the SetFocus implementation provided in docs? https://learn.microsoft.com/en-us/power-platform/guidance/creator-kit/setfocus
@sperry1625 just wanted to follow up and check in - did the SetFocus using a variable work for you?
@denise-msft, I have to retest. I believe IO have tried the SetFocus as described and it is not supported in all controls.
I will retest my scenario and let you know.
Regards,
SP
@sperry1625 please let us know if this is not working when you have a chance to try it out.
Since we haven’t received a response, we’re closing this case. Please let us know if you need additional help by reopening the issue.