Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Fixes issue #59 #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixes issue #59 #61

wants to merge 1 commit into from

Conversation

jrock2004
Copy link
Contributor

I was not sure the meaning behind limiting attr copying to just a few attributes. Removed them all. If there was a reason I could re-write it pull all data attributes and some other known ones

@iamEAP
Copy link
Contributor

iamEAP commented Aug 3, 2016

Thanks @jrock2004! I was trying to remember why we limited the attributes to begin with, and I think I figured it out: in many situations, we're copying attributes from an <input> element to a <select> element or vice versa.

Perhaps instead of a whitelist, we can maintain blacklists in each direction (select->input, input->select)?

@jrock2004
Copy link
Contributor Author

Would that be something that a user would have to pass in themselves? Or do we just create such list? If so any ideas on what to blacklist?

@iamEAP
Copy link
Contributor

iamEAP commented Aug 4, 2016

Probably something we should provide. Users can override this attribute copy method if they want to anyway.

I'm looking at the spec for the select and input elements on MDN.

You can check my math, but it looks like the limitations are only in one direction. Any valid attribute on a <select> element can be copied to an <input> element without any issues, but there are tons of attributes on <input> elements that are irrelevant to <select> elements.

I'm also wondering whether or not it's wise to copy event handler attributes (like onload, onclick, etc).

Some research:

Attribute blacklist for input-to-select transition

Basically a list of attributes that are unique to input elements.

  • type
  • accept
  • accesskey
  • mozactionhint
  • autocapitalize
  • autocomplete
  • autocorrect
  • capture
  • checked
  • formaction
  • formenctype
  • formmethod
  • formnovalidate
  • formtarget
  • height
  • incremental
  • inputmode
  • list
  • max
  • maxlength
  • min
  • minlength
  • pattern
  • placeholder
  • readonly
  • results
  • selectionDirection
  • spellcheck
  • src
  • step
  • usemap
  • value
  • webkitdirectory
  • width
  • x-moz-errormessage

Attribute blacklist for select-to-input transition

I could not find any attributes that <select> elements have that <input> elements do not have.

Attributes that are definitely shared

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

Successfully merging this pull request may close these issues.

2 participants