Skip to content

[website] Fix jump on the header#6312

Merged
zpao merged 1 commit intofacebook:masterfrom
vjeux:fix_docs_jump
Mar 21, 2016
Merged

[website] Fix jump on the header#6312
zpao merged 1 commit intofacebook:masterfrom
vjeux:fix_docs_jump

Conversation

@vjeux
Copy link
Contributor

@vjeux vjeux commented Mar 21, 2016

Algolia adds two inline styles

  position: relative;
  vertical-align: top;

to the element once the script inserted at the end of the page runs which super slightly moves the header. The fix is to always apply those two rules this way it doesn't jump. I did not notice it on my machine because it doesn't move when custom fonts are not being used.

Test Plan:

  • Open two tabs: reactjs.com and localhost:4000/react
  • Click around on reactjs.com to prime the cache with the fonts
  • Switch tabs and click around on localhost (but do not force refresh!)
  • Now you get custom fonts loaded locally and it doesn't jump when you change tabs

Algolia adds two inline styles

```css
  position: relative;
  vertical-align: top;
```

to the element once the script inserted at the end of the page runs which super slightly moves the header. The fix is to always apply those two rules this way it doesn't jump. I did not notice it on my machine because it doesn't move when custom fonts are not being used.

Test Plan:
- Open two tabs: reactjs.com and localhost:4000/react
- Click around on reactjs.com to prime the cache with the fonts
- Switch tabs and click around on localhost (but do not force refresh!)
- Now you get custom fonts loaded locally and it doesn't jump when you change tabs
@vjeux
Copy link
Contributor Author

vjeux commented Mar 21, 2016

cc @gaearon, @zpao. Sorry about shipping with this super ugly bug :(

@zpao
Copy link
Member

zpao commented Mar 21, 2016

I don't see the issue and fonts should be loading for localhost… But ok!

zpao added a commit that referenced this pull request Mar 21, 2016
[website] Fix jump on the header
@zpao zpao merged commit 39ccdcc into facebook:master Mar 21, 2016
@facebook-github-bot
Copy link
Contributor

@vjeux updated the pull request.

zpao added a commit that referenced this pull request Mar 21, 2016
[website] Fix jump on the header
(cherry picked from commit 39ccdcc)
1999 pushed a commit to 1999/react that referenced this pull request Mar 30, 2016
* upstream-v0.14.8: (191 commits)
  v0.14.8
  Update README and CHANGELOG for 0.14.8
  Bump version of 0.14.8 dev
  Use babel 5 bin, not cached babel 6 cli
  [debug] log npm packages
  Merge pull request facebook#6312 from vjeux/fix_docs_jump
  Merge pull request facebook#6313 from jimfb/script-integrity-attribute
  Merge pull request facebook#6281 from rgarifullin/microfix_docs
  Merge pull request facebook#6260 from iawia002/master
  Merge pull request facebook#6258 from iamchenxin/zh_docs031316rest
  Merge pull request facebook#6256 from iamchenxin/zh_docs031316
  Merge pull request facebook#6202 from vjeux/search
  Add v15 RC2 blog post
  Merge pull request facebook#6214 from koba04/patch-6
  Merge pull request facebook#6208 from JinxiuLee/patch-2
  Fix style= formatting in v15 rc blog post
  Merge pull request facebook#6207 from zpao/15rc-blog-post-corrections
  v15.0 rc1 blog post
  Merge pull request facebook#6180 from camjc/master
  Merge pull request facebook#6183 from jimfb/rec-update
  ...
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.

3 participants