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

Keypress triggering unnecessary layout reflow #2268

Closed
leandrogaspar opened this issue Aug 23, 2018 · 0 comments
Closed

Keypress triggering unnecessary layout reflow #2268

leandrogaspar opened this issue Aug 23, 2018 · 0 comments

Comments

@leandrogaspar
Copy link
Contributor

Regardless of need, the IconPicker selectItem() function triggers a layout reflow for each keystroke. This may seems like nitpicking, however, it almost doubles the time spent on Layout. On complex applications/mobile the impact is significant.

selectItem(target, trigger) {
    super.selectItem(target, trigger);
    const item = target || this.defaultItem;
    this.label.innerHTML = item.innerHTML; <-- Layout reflow
  }

Steps for Reproduction

  1. Visit https://codepen.io/leandrogaspar/pen/BONZRQ
  2. Open Google Chrome Performance tab and start recording
  3. Type something on the editor

Expected behavior:
Icon Picker should not trigger layout reflow for each keystroke

Actual behavior:
image
image

Platforms:
Chrome Version 68.0.3440.106 (Official Build) (64-bit)

Version:
1.3.6

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

No branches or pull requests

2 participants