-
Notifications
You must be signed in to change notification settings - Fork 162
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
Refresh DataTransfer API #763
Refresh DataTransfer API #763
Conversation
Co-authored-by: Arman Bilge <[email protected]>
Co-authored-by: Arman Bilge <[email protected]>
/** Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be | ||
* provided also. | ||
*/ | ||
def add(data: File): Unit = js.native |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDN says this has a defined return value :)
A DataTransferItem containing the specified data. If the drag item couldn't be created (for example, if the associated DataTransfer object has no data store), null is returned.
https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/add#return_value
api-reports/2_12.txt
Outdated
DataTransfer[JT] var dropEffect: DropEffectValue | ||
DataTransfer[JT] var effectAllowed: EffectAllowedValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, after many sleepless nights I propose:
DataTransferDropEffectKind
DataTransferEffectAllowedKind
Rationale:
- Prefix with
DataTransfer
to "namespace" them. Since we are just making these names up, there's no guarantee that there won't be some other unrelatedDropEffect
orEffectAllowed
API added in the future, that would clash with the name. - Postfix with
Kind
, because the spec describes it as "the kind of operation". Furthermore, looking through other enums we've facaded, we have various "kinds" but not any "values".
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix to namespace sounds extremely meh, but I can't argue with that reasoning :P.
And yes postfixing with Kind
sounds great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix to namespace sounds extremely me
Heh yeah, welcome to browsers where everything is in the global namespace 😛 anyway we have various precedents for doing that as well, some of which I think has been copied from spec/TS/something 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! This was a big one.
Should resolve #738