Skip to content

Commit

Permalink
Revert "popoverTarget -> popoverTargetElement"
Browse files Browse the repository at this point in the history
This reverts commit b394c00.
  • Loading branch information
eps1lon committed May 17, 2024
1 parent 29b66a5 commit 5d43e38
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 57 deletions.
31 changes: 3 additions & 28 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -8476,7 +8476,7 @@
## `popoverTarget` (on `<button>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `popoverTarget=(string)`| (initial, warning)| `<null>` |
| `popoverTarget=(string)`| (initial)| `<null>` |
| `popoverTarget=(empty string)`| (initial)| `<null>` |
| `popoverTarget=(array with string)`| (initial)| `<null>` |
| `popoverTarget=(empty array)`| (initial)| `<null>` |
Expand All @@ -8498,31 +8498,6 @@
| `popoverTarget=(null)`| (initial)| `<null>` |
| `popoverTarget=(undefined)`| (initial)| `<null>` |

## `popoverTargetElement` (on `<button>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `popoverTargetElement=(string)`| (initial)| `<null>` |
| `popoverTargetElement=(empty string)`| (initial)| `<null>` |
| `popoverTargetElement=(array with string)`| (initial)| `<null>` |
| `popoverTargetElement=(empty array)`| (initial)| `<null>` |
| `popoverTargetElement=(object)`| (initial)| `<null>` |
| `popoverTargetElement=(numeric string)`| (initial)| `<null>` |
| `popoverTargetElement=(-1)`| (initial)| `<null>` |
| `popoverTargetElement=(0)`| (initial)| `<null>` |
| `popoverTargetElement=(integer)`| (initial)| `<null>` |
| `popoverTargetElement=(NaN)`| (initial, warning)| `<null>` |
| `popoverTargetElement=(float)`| (initial)| `<null>` |
| `popoverTarget=(true)`| (initial, warning)| `<null>` |
| `popoverTargetElement=(false)`| (initial, warning)| `<null>` |
| `popoverTargetElement=(string 'true')`| (initial)| `<null>` |
| `popoverTargetElement=(string 'false')`| (initial)| `<null>` |
| `popoverTargetElement=(string 'on')`| (initial)| `<null>` |
| `popoverTargetElement=(string 'off')`| (initial)| `<null>` |
| `popoverTargetElement=(symbol)`| (initial, warning)| `<null>` |
| `popoverTargetElement=(function)`| (initial, warning)| `<null>` |
| `popoverTargetElement=(null)`| (initial)| `<null>` |
| `popoverTargetElement=(undefined)`| (initial)| `<null>` |

## `popoverTargetAction` (on `<button>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand All @@ -8537,8 +8512,8 @@
| `popoverTargetAction=(integer)`| (initial)| `"toggle"` |
| `popoverTargetAction=(NaN)`| (initial, warning)| `"toggle"` |
| `popoverTargetAction=(float)`| (initial)| `"toggle"` |
| `popoverTargetAction=(true)`| (initial)| `"toggle"` |
| `popoverTargetAction=(false)`| (initial)| `"toggle"` |
| `popoverTargetAction=(true)`| (initial, warning)| `"toggle"` |
| `popoverTargetAction=(false)`| (initial, warning)| `"toggle"` |
| `popoverTargetAction=(string 'true')`| (initial)| `"toggle"` |
| `popoverTargetAction=(string 'false')`| (initial)| `"toggle"` |
| `popoverTargetAction=(string 'on')`| (initial)| `"toggle"` |
Expand Down
5 changes: 0 additions & 5 deletions fixtures/attribute-behavior/src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,11 +1453,6 @@ const attributes = [
read: element => element.popoverTargetElement,
tagName: 'button',
},
{
name: 'popoverTargetElement',
read: element => element.popoverTargetElement,
tagName: 'button',
},
{name: 'popoverTargetAction', overrideStringValue: 'show', tagName: 'button'},
{
name: 'poster',
Expand Down
2 changes: 0 additions & 2 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1815,8 +1815,6 @@ function getPropNameFromAttributeName(attrName: string): string {
return 'className';
case 'for':
return 'htmlFor';
case 'popopverTarget':
return 'popopverTargetElement';
// TODO: The rest of the aliases.
default:
return attrName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
const aliases = new Map([
['acceptCharset', 'accept-charset'],
['htmlFor', 'for'],
['popoverTargetElement', 'popoverTarget'],
['httpEquiv', 'http-equiv'],
// HTML and SVG attributes, but the SVG attribute is case sensitive.],
['crossOrigin', 'crossorigin'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,8 @@ const possibleStandardNames = {
pointsaty: 'pointsAtY',
pointsatz: 'pointsAtZ',
popover: 'popover',
popovertarget: 'popoverTargetElement',
popovertarget: 'popoverTarget',
popovertargetaction: 'popoverTargetAction',
popovertargetelement: 'popoverTargetElement',
prefix: 'prefix',
preservealpha: 'preserveAlpha',
preserveaspectratio: 'preserveAspectRatio',
Expand Down
19 changes: 0 additions & 19 deletions packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,18 +2926,6 @@ describe('ReactDOMComponent', () => {
}).toErrorDev(
'Warning: Invalid DOM property `autofocus`. Did you mean `autoFocus`?\n in input',
);

await expect(async () => {
const container = document.createElement('div');
const root = ReactDOMClient.createRoot(container);
await act(() => {
root.render(
React.createElement('button', {popoverTarget: 'some-element'}),
);
});
}).toErrorDev(
'Warning: Invalid DOM property `popoverTarget`. Did you mean `popoverTargetElement`?\n in button',
);
});

it('should suggest property name if available (ssr)', () => {
Expand All @@ -2955,13 +2943,6 @@ describe('ReactDOMComponent', () => {
).toErrorDev(
'Warning: Invalid DOM property `autofocus`. Did you mean `autoFocus`?\n in input',
);
expect(() =>
ReactDOMServer.renderToString(
React.createElement('button', {popoverTarget: 'some-element'}),
),
).toErrorDev(
'Warning: Invalid DOM property `popoverTarget`. Did you mean `popoverTargetElement`?\n in button',
);
});
});

Expand Down

0 comments on commit 5d43e38

Please sign in to comment.