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

#14 Fix placeholder #15

Merged
merged 3 commits into from
Jun 26, 2018
Merged

#14 Fix placeholder #15

merged 3 commits into from
Jun 26, 2018

Conversation

RyoNkmr
Copy link
Owner

@RyoNkmr RyoNkmr commented Jun 26, 2018

this closes #14

Changes

Before

i14

After

i14fixed

@RyoNkmr RyoNkmr self-assigned this Jun 26, 2018
@RyoNkmr RyoNkmr requested a review from resessh June 26, 2018 03:32
@RyoNkmr RyoNkmr added the bug Something isn't working label Jun 26, 2018
return document.querySelector(value) || fallback;

const element: ?HTMLElement = ([document.querySelector(value), ...fallbacks]
.find(item => !!item && item instanceof HTMLElement): any);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 Array.prototype.[filter|find] type refinement problem workaround
facebook/flow#1414 (comment)

😭

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the power of Typescript 🙄

@RyoNkmr RyoNkmr changed the title #I14 Fix plaeholder #I14 Fix placeholder Jun 26, 2018
@RyoNkmr RyoNkmr changed the title #I14 Fix placeholder #14 Fix placeholder Jun 26, 2018
Copy link
Collaborator

@resessh resessh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ask

throw new Error('[Stuck.js] document.body is not HTMLElement in this environment');
set wrapper(value: SelectorOrElement): void {
if (!(document.body instanceof HTMLElement)) {
throw new TypeError('[Stuck.js] document.body is not HTMLElement in this environment');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@@ -1,11 +1,14 @@
/* @flow */
import Placeholder from './placeholder';

type MaybeHTMLElement = HTMLElement|Element|null|void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this include void?

Copy link
Owner Author

@RyoNkmr RyoNkmr Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.parentElement: ?Element;

https://github.com/facebook/flow/blob/v0.75.0/lib/dom.js#L439

that's why includes void

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood 👍

return document.querySelector(value) || fallback;

const element: ?HTMLElement = ([document.querySelector(value), ...fallbacks]
.find(item => !!item && item instanceof HTMLElement): any);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the power of Typescript 🙄

Copy link
Collaborator

@resessh resessh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks gooood 👍

@RyoNkmr RyoNkmr merged commit 760fe23 into master Jun 26, 2018
@RyoNkmr RyoNkmr deleted the i14-ryonkmr-fix_plaeholder branch June 26, 2018 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Placeholder does not hold place
2 participants