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

[Pivots] Support form-associate custom element (FACE) callbacks #3000

Closed
nolanlawson opened this issue Aug 11, 2022 · 5 comments
Closed

[Pivots] Support form-associate custom element (FACE) callbacks #3000

nolanlawson opened this issue Aug 11, 2022 · 5 comments

Comments

@nolanlawson
Copy link
Collaborator

Description

As seen in Polymer's implementation, pivots (#2724) should support FACE callbacks such as formAssociatedCallback and formDisabledCallback.

@git2gus
Copy link

git2gus bot commented Aug 11, 2022

This issue has been linked to a new work item: W-11585205

@nolanlawson
Copy link
Collaborator Author

I started implementing this, but there is an interesting wrinkle: FACE assumes you add static formAssociated = true to your custom element class, similar to how static observedAttributes work.

So you only get one chance to make an element form-associated. This is a problem if we have class A which is registered first and not form-associated, and then class B which is registered second and is form-associated. A few possibilities:

  1. Set static formAssociated = true for every PivotCtor, just in case someone wants to be form-associated. If the callback is invoked by the browser on a non-form-associated element, just ignore it.
  2. Avoid setting static formAssociated = true for class A, and then implement some kind of polyfill for class B.

Both options make me nervous. FWIW Polymer's polyfill seems to go for option #1 but not bother to ignore FACE callbacks for non-FACE elements.

@caridy
Copy link
Contributor

caridy commented Jan 25, 2023

At this point name collision should not be a thing... so we should be fine to use formAssociated if the Ctor has it at the time of declaration of the upgradable class.

@nolanlawson
Copy link
Collaborator Author

Pivots were dropped in #3310

@caridy
Copy link
Contributor

caridy commented Jan 30, 2023

@rwaldron do we need this in locker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants