mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove form event delegation flag (#19395)
This commit is contained in:
@@ -278,10 +278,10 @@ describe('ReactDOMEventListener', () => {
|
||||
document.body.removeChild(container);
|
||||
});
|
||||
|
||||
// This is a special case for submit and reset events as they are listened on
|
||||
// at the element level and not the document.
|
||||
// @see https://github.com/facebook/react/pull/13462
|
||||
it('should (or not) receive submit events if native, interim DOM handler prevents it', () => {
|
||||
// This tests an implementation detail that submit/reset events are listened to
|
||||
// at the document level, which is necessary for event replaying to work.
|
||||
// They bubble in all modern browsers.
|
||||
it('should not receive submit events if native, interim DOM handler prevents it', () => {
|
||||
const container = document.createElement('div');
|
||||
document.body.appendChild(container);
|
||||
|
||||
@@ -316,13 +316,8 @@ describe('ReactDOMEventListener', () => {
|
||||
}),
|
||||
);
|
||||
|
||||
if (gate(flags => flags.enableFormEventDelegation)) {
|
||||
expect(handleSubmit).not.toHaveBeenCalled();
|
||||
expect(handleReset).not.toHaveBeenCalled();
|
||||
} else {
|
||||
expect(handleSubmit).toHaveBeenCalled();
|
||||
expect(handleReset).toHaveBeenCalled();
|
||||
}
|
||||
expect(handleSubmit).not.toHaveBeenCalled();
|
||||
expect(handleReset).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
document.body.removeChild(container);
|
||||
}
|
||||
|
||||
@@ -43,8 +43,6 @@ import {
|
||||
TOP_INVALID,
|
||||
TOP_SCROLL,
|
||||
TOP_CLOSE,
|
||||
TOP_RESET,
|
||||
TOP_SUBMIT,
|
||||
TOP_CAN_PLAY,
|
||||
TOP_CAN_PLAY_THROUGH,
|
||||
TOP_DURATION_CHANGE,
|
||||
@@ -83,7 +81,6 @@ import getListener from './getListener';
|
||||
import {passiveBrowserEventsSupported} from './checkPassiveEvents';
|
||||
|
||||
import {
|
||||
enableFormEventDelegation,
|
||||
enableLegacyFBSupport,
|
||||
enableCreateEventHandleAPI,
|
||||
enableScopeAPI,
|
||||
@@ -244,11 +241,6 @@ export const capturePhaseEvents: Set<DOMTopLevelEventType> = new Set([
|
||||
TOP_WAITING,
|
||||
]);
|
||||
|
||||
if (!enableFormEventDelegation) {
|
||||
capturePhaseEvents.add(TOP_SUBMIT);
|
||||
capturePhaseEvents.add(TOP_RESET);
|
||||
}
|
||||
|
||||
if (enableCreateEventHandleAPI) {
|
||||
capturePhaseEvents.add(TOP_AFTER_BLUR);
|
||||
}
|
||||
|
||||
@@ -127,6 +127,3 @@ export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
// Replacement for runWithPriority in React internals.
|
||||
export const decoupleUpdatePriorityFromScheduler = false;
|
||||
|
||||
// Enables delegation for submit and reset events.
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
@@ -44,7 +44,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,7 +43,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,7 +43,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,7 +43,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,7 +43,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,7 +43,6 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = !__EXPERIMENTAL__;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const enableFormEventDelegation = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,5 +43,3 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
||||
// to __VARIANT__.
|
||||
export const enableTrustedTypesIntegration = false;
|
||||
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
|
||||
|
||||
export const enableFormEventDelegation = __VARIANT__;
|
||||
|
||||
@@ -27,7 +27,6 @@ export const {
|
||||
decoupleUpdatePriorityFromScheduler,
|
||||
enableDebugTracing,
|
||||
enableSchedulingProfiler,
|
||||
enableFormEventDelegation,
|
||||
} = dynamicFeatureFlags;
|
||||
|
||||
// On WWW, __EXPERIMENTAL__ is used for a new modern build.
|
||||
|
||||
Reference in New Issue
Block a user