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

Fixes autofocus does not work when the dialog has opened #24376

Closed
wants to merge 3 commits into from
Closed

Fixes autofocus does not work when the dialog has opened #24376

wants to merge 3 commits into from

Conversation

MustafaEminn
Copy link

Summary

Fixes #23301. Dialog elements already have been rendered when the open props value has changed.

How did you test this change?

I have tried the dispatchEvent but that can't render properly. The important point is the input element should have autoFocus={true} property before open the dialog.

* __DEV__ condition removed from update container because onScheduleRoot has already a __DEV__ condition.

* Removed __DEV__ condition in catch scope.
@sizebot
Copy link

sizebot commented Apr 14, 2022

Comparing: 1f7a901...ba5622a

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js +0.27% 131.40 kB 131.76 kB +0.21% 41.99 kB 42.07 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.26% 136.45 kB 136.81 kB +0.33% 43.43 kB 43.57 kB
facebook-www/ReactDOM-prod.classic.js +0.33% 433.07 kB 434.50 kB +0.29% 79.60 kB 79.83 kB
facebook-www/ReactDOM-prod.modern.js +0.34% 418.07 kB 419.50 kB +0.28% 77.24 kB 77.46 kB
facebook-www/ReactDOMForked-prod.classic.js +0.33% 433.07 kB 434.50 kB +0.29% 79.61 kB 79.84 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js +0.66% 247.59 kB 249.23 kB +0.53% 45.26 kB 45.50 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js +0.64% 262.37 kB 264.07 kB +0.49% 47.60 kB 47.83 kB
react-native/implementations/ReactFabric-prod.js +0.59% 277.47 kB 279.10 kB +0.49% 50.12 kB 50.37 kB
react-native/implementations/ReactNativeRenderer-prod.js +0.58% 284.08 kB 285.72 kB +0.49% 51.31 kB 51.56 kB
react-native/implementations/ReactFabric-prod.fb.js +0.56% 290.22 kB 291.86 kB +0.48% 52.55 kB 52.80 kB
react-native/implementations/ReactNativeRenderer-prod.fb.js +0.56% 292.21 kB 293.86 kB +0.47% 53.00 kB 53.25 kB
react-native/implementations/ReactFabric-profiling.js +0.55% 296.44 kB 298.06 kB +0.39% 53.39 kB 53.60 kB
react-native/implementations/ReactNativeRenderer-profiling.js +0.54% 303.09 kB 304.72 kB +0.42% 54.49 kB 54.71 kB
facebook-www/ReactART-prod.modern.js +0.53% 267.20 kB 268.62 kB +0.45% 47.60 kB 47.81 kB
facebook-www/ReactART-prod.classic.js +0.51% 277.99 kB 279.41 kB +0.43% 49.39 kB 49.60 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js +0.51% 319.07 kB 320.70 kB +0.40% 57.17 kB 57.39 kB
react-native/implementations/ReactFabric-profiling.fb.js +0.51% 317.19 kB 318.80 kB +0.37% 56.83 kB 57.04 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.42% 81.88 kB 82.23 kB +0.51% 25.31 kB 25.44 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.42% 81.88 kB 82.23 kB +0.51% 25.31 kB 25.44 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js +0.42% 84.00 kB 84.35 kB +0.55% 25.85 kB 26.00 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js +0.42% 84.00 kB 84.35 kB +0.55% 25.85 kB 26.00 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js +0.42% 84.20 kB 84.55 kB +0.48% 26.16 kB 26.28 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js +0.42% 84.20 kB 84.55 kB +0.48% 26.16 kB 26.28 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.42% 411.94 kB 413.66 kB +0.33% 77.43 kB 77.68 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.40% 428.37 kB 430.09 kB +0.33% 80.17 kB 80.43 kB
oss-experimental/react-art/cjs/react-art.production.min.js +0.40% 86.49 kB 86.83 kB +0.44% 26.69 kB 26.81 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js +0.40% 88.25 kB 88.60 kB +0.52% 27.13 kB 27.27 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js +0.40% 88.45 kB 88.80 kB +0.51% 27.37 kB 27.51 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js +0.37% 92.69 kB 93.03 kB +0.19% 28.43 kB 28.48 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js +0.37% 92.69 kB 93.03 kB +0.19% 28.43 kB 28.48 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js +0.36% 97.35 kB 97.69 kB +0.65% 29.68 kB 29.87 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js +0.34% 101.59 kB 101.94 kB +0.43% 30.62 kB 30.75 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js +0.34% 101.59 kB 101.94 kB +0.43% 30.62 kB 30.75 kB
facebook-www/ReactDOM-prod.modern.js +0.34% 418.07 kB 419.50 kB +0.28% 77.24 kB 77.46 kB
facebook-www/ReactDOMForked-prod.modern.js +0.34% 418.07 kB 419.50 kB +0.28% 77.25 kB 77.46 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js +0.33% 106.25 kB 106.60 kB +0.45% 31.98 kB 32.13 kB
facebook-www/ReactDOM-prod.classic.js +0.33% 433.07 kB 434.50 kB +0.29% 79.60 kB 79.83 kB
facebook-www/ReactDOMForked-prod.classic.js +0.33% 433.07 kB 434.50 kB +0.29% 79.61 kB 79.84 kB
facebook-www/ReactDOM-profiling.modern.js +0.32% 448.74 kB 450.17 kB +0.28% 81.79 kB 82.02 kB
facebook-www/ReactDOMForked-profiling.modern.js +0.32% 448.74 kB 450.17 kB +0.28% 81.80 kB 82.03 kB
facebook-www/ReactDOM-profiling.classic.js +0.31% 463.83 kB 465.26 kB +0.27% 84.21 kB 84.45 kB
facebook-www/ReactDOMForked-profiling.classic.js +0.31% 463.83 kB 465.26 kB +0.27% 84.22 kB 84.45 kB
oss-stable-semver/react-art/umd/react-art.production.min.js +0.30% 117.78 kB 118.13 kB +0.40% 36.52 kB 36.66 kB
oss-stable/react-art/umd/react-art.production.min.js +0.30% 117.78 kB 118.13 kB +0.40% 36.52 kB 36.66 kB
oss-experimental/react-art/umd/react-art.production.min.js +0.29% 122.31 kB 122.67 kB +0.31% 37.88 kB 37.99 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js +0.28% 131.50 kB 131.86 kB +0.30% 42.64 kB 42.77 kB
oss-stable/react-dom/umd/react-dom.production.min.js +0.28% 131.50 kB 131.86 kB +0.30% 42.64 kB 42.77 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js +0.27% 131.40 kB 131.76 kB +0.21% 41.99 kB 42.07 kB
oss-stable/react-dom/cjs/react-dom.production.min.js +0.27% 131.40 kB 131.76 kB +0.21% 41.99 kB 42.07 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js +0.27% 136.38 kB 136.75 kB +0.29% 43.90 kB 44.03 kB
oss-experimental/react-dom/umd/react-dom.production.min.js +0.27% 136.50 kB 136.86 kB +0.29% 44.10 kB 44.23 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.26% 136.45 kB 136.81 kB +0.33% 43.43 kB 43.57 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js +0.26% 140.26 kB 140.62 kB +0.32% 44.89 kB 45.03 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js +0.26% 140.26 kB 140.62 kB +0.32% 44.89 kB 45.03 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js +0.25% 140.83 kB 141.19 kB +0.33% 44.48 kB 44.63 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js +0.25% 140.83 kB 141.19 kB +0.33% 44.48 kB 44.63 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js +0.24% 145.90 kB 146.25 kB +0.25% 45.94 kB 46.05 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js +0.24% 145.24 kB 145.59 kB +0.28% 46.33 kB 46.46 kB

Generated by 🚫 dangerJS against ba5622a

@MustafaEminn MustafaEminn marked this pull request as draft April 14, 2022 15:13
@MustafaEminn MustafaEminn marked this pull request as ready for review April 14, 2022 15:14
@MustafaEminn MustafaEminn reopened this Apr 14, 2022
@MustafaEminn
Copy link
Author

@rickhanlonii can you review this please

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in CommitWork is not platform-specific and shouldn't include concepts like "dialog". Can you briefly describe what you're trying to do?

@MustafaEminn
Copy link
Author

MustafaEminn commented Apr 14, 2022

My purpose focus to the element which has autoFocus prop when a dialog opens. dialog is being rendered on the first mount even if not visible. React is being looked at to elements that have autoFocus property only first mount. I look up again to children that have autoFocus property when the dialog has opened.

@MustafaEminn
Copy link
Author

Can I do that? Where do I put begin and complete methods?
image

@MustafaEminn MustafaEminn requested a review from gaearon April 14, 2022 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: autoFocus broken inside <dialog />
4 participants