box / box-content-preview

JavaScript library for rendering files stored on Box
https://developer.box.com/docs/box-content-preview
Other
106 stars 113 forks source link

When previewing lots of Box Files on same web page, the webpage will jump up and down #365

Open hxwhou opened 7 years ago

hxwhou commented 7 years ago

Please fill out the following template so we can reproduce and fix your issue as quickly as possible!

Environment:

Steps to reproduce the problem:

  1. preview lots of box files on same webpage
  2. Programmtically focus on the viewer after it loads
    // Programmtically focus on the viewer after it loads
    if (this.viewer && this.viewer.containerEl) {
        this.viewer.containerEl.focus();
    }
  3. I am not sure whether it is a good experience in this situation, because it will make the screen jump

What is the expected behavior? (Screenshots can be helpful here) I don't want to focus on the viewer after it loads, so could you please provide a method or param to prevent focus automatically in source code.

What went wrong? (Screenshots can be helpful here)

image image image

Link to application or sample code:

If relevant, link to file (or attach file here):

tonyjin commented 7 years ago

Thanks for the report! We'll take a look.

hxwhou commented 7 years ago

Auto focus is a good feature when there is only one preview container. But when a lots of preview container on the same web page, it looks not good. So maybe provide a parameter to control whether to focus or not is a good idea. Looking froward to next release this bug will be fixed. Many thanks!