fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Pickers throw error when autoFocus prop is set

Open abettadapur opened this issue 9 years ago • 4 comments

Bug Report

  • Package version(s): 4.21.3
  • Browser and OS versions: All

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? (Yes, No)

Requested priority: (Blocking, High, Normal, Low) Normal

Products/sites affected: (if applicable)

Describe the issue:

When specifying the autoFocus prop on a Picker, the following console error is thrown on mount

{inputProps: {autoFocus: true}}
Uncaught TypeError: Cannot read property 'value' of undefined
    at NormalPeoplePicker.BasePicker.onInputFocus (appstart.js:34549)
    at Object.ReactErrorUtils.invokeGuardedCallback (react.js:46008)
    at executeDispatch (react.js:39997)
    at Object.executeDispatchesInOrder (react.js:40017)
    at executeDispatchesAndRelease (react.js:39422)
    at executeDispatchesAndReleaseTopLevel (react.js:39433)
    at Array.forEach (<anonymous>)
    at forEachAccumulated (react.js:52414)
    at Object.processEventQueue (react.js:39636)
    at runEventQueueInBatch (react.js:46032)

The focus still works, but we should not see this error

Actual behavior:

Console error is thrown

Expected behavior:

No console error should be thrown.

abettadapur avatar Aug 22 '17 21:08 abettadapur

Though I'd have a look at this, but can't find autoFocus in the codebase of latest (4.37.5) at all. IS there still a bug, or could this have been fixed already and should be closed?

ohritz avatar Aug 26 '17 14:08 ohritz

autoFocus is part of inputProps. https://github.com/OfficeDev/office-ui-fabric-react/blob/73706e0bee1ca3eede408a9602a6f5dd9258d31e/packages/office-ui-fabric-react/src/components/pickers/BasePicker.Props.ts#L78

I will upgrade Fabric, and see if the issue recurrs

abettadapur avatar Aug 28 '17 15:08 abettadapur

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 01:04 stale[bot]

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar May 18 '18 23:05 stale[bot]