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

fix(5018): compare wholeText instead of data #5028

Merged
merged 2 commits into from
Jul 7, 2020
Merged

fix(5018): compare wholeText instead of data #5028

merged 2 commits into from
Jul 7, 2020

Conversation

skippednote
Copy link
Contributor

This PR addresses #5018.
Instead of comparing the input with data property on the Text Node, I've changed it to wholeText.

@Conduitry
Copy link
Member

Is this something that it's possible to write a test for? I note that the original bug wasn't something I could reproduce on Firefox - I was only seeing it on Chrome - so there's something peculiar going on here, and I don't know what behavior JSDOM has - and I also don't know whether the behavior of one browser or the other could be considered a bug.

Also, do you know what the support of wholeText is? We'd like to try not to use things that aren't easily transpilable or polyfillable on the last couple versions of IE. I see on https://caniuse.com/#feat=mdn-api_text_wholetext that it's supported on IE11, but I don't see any information about earlier than that.

@skippednote
Copy link
Contributor Author

skippednote commented Jun 25, 2020

@Conduitry I've been trying to figure out how to test this, but haven't had any luck so far.
The following doesn't help replicate the behaviour we see in the repl. Any pointers on how to proceed?

div.textContent = 'something';
div.dispatchEvent(new InputEvent('input'));

I'll be check support for wholeText in previous versions on IE using BrowserStack and report back here.

@Conduitry I just checked, wholeText is supported in IE9 and above.

@skippednote
Copy link
Contributor Author

@Conduitry I've figured out a way to test it by replicating the current behaviour. Here is a vanilla JS emulation https://jsbin.com/ziperitova/edit?html,js,output

@Conduitry Conduitry merged commit ce3d046 into sveltejs:master Jul 7, 2020
hontas added a commit to hontas/svelte that referenced this pull request Jul 18, 2020
* upstream/master: (190 commits)
  invalidate $$props and $$restProps only when there are changes (sveltejs#5123)
  site: use https in link in blog (sveltejs#5148)
  Simplify each block bindings example (sveltejs#5094)
  fix $$props reactive for slots (sveltejs#5125)
  site: add FAQ entry for how to document a svelte component (sveltejs#5131)
  site: remove an obsolete TODO in blog post (sveltejs#5135)
  Increase timeout for unit build
  Increase timeout for unit tests
  -> v3.24.0
  spread condition for input element (sveltejs#5004)
  update changelog
  fix(5018): compare wholeText instead of data (sveltejs#5028)
  html anchor in head (sveltejs#5071)
  error on expression scope store (sveltejs#5079)
  update changelog
  preprocess self-closing script and style tags (sveltejs#5082)
  update changelog
  fix: Parameters with default values are optional (sveltejs#5083)
  make builds time out after a reasonable period (sveltejs#5100)
  site: fix blog typo (sveltejs#5090)
  ...
hontas added a commit to hontas/svelte that referenced this pull request Jul 18, 2020
* master: (67 commits)
  add updating guard to binding callback (sveltejs#5126)
  Bump lodash from 4.17.15 to 4.17.19 (sveltejs#5152)
  Bump lodash from 4.17.15 to 4.17.19 in /site (sveltejs#5155)
  Fixes sveltejs#5153 (sveltejs#5154)
  invalidate $$props and $$restProps only when there are changes (sveltejs#5123)
  site: use https in link in blog (sveltejs#5148)
  Simplify each block bindings example (sveltejs#5094)
  fix $$props reactive for slots (sveltejs#5125)
  site: add FAQ entry for how to document a svelte component (sveltejs#5131)
  site: remove an obsolete TODO in blog post (sveltejs#5135)
  Increase timeout for unit build
  Increase timeout for unit tests
  -> v3.24.0
  spread condition for input element (sveltejs#5004)
  update changelog
  fix(5018): compare wholeText instead of data (sveltejs#5028)
  html anchor in head (sveltejs#5071)
  error on expression scope store (sveltejs#5079)
  update changelog
  preprocess self-closing script and style tags (sveltejs#5082)
  ...
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants