microsoft / powercat-creator-kit

This toolkit helps create well-designed Power App experiences on the web & mobile. It contains a component library; PCF controls and other utilities that increase developer productivity.
MIT License
321 stars 53 forks source link

[BUG]: SetFocus() Doesn't Work on Any Creative Kit Controls #400

Closed sperry1625 closed 2 months ago

sperry1625 commented 1 year ago

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:

  1. Drop a picker, panel, or other CreativeKit control on a Screen
  2. Drop a label on the screen
  3. Group the controls from step 1 and step 2 (This is not necessary, but it is what I have done)
  4. Drop a button on the same screen
  5. In the OnSelect() for the button add a SetFocus() to one of the controls added in step 1
  6. See error

Expected behavior No error and the SetFocus() to work

Screenshots

image

Additional context This works on any regular controls that are in the same place.

denise-msft commented 1 year ago

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

denise-msft commented 12 months ago

@sperry1625 just wanted to follow up and check in - did the SetFocus using a variable work for you?

sperry1625 commented 11 months ago

@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

denise-msft commented 9 months ago

@sperry1625 please let us know if this is not working when you have a chance to try it out.

denise-msft commented 2 months ago

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.