Page MenuHomePhabricator

Fullscreen button broken with newer version of bootstrap-table
Closed, ResolvedPublic

Description

The bootstrap-table folks added the following rule to bootstrap-table.css:

.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%!important;
    background: #FFF;
}

It’s not scoped or anything, so it breaks our fullscreen button – the position: fixed yanks it out of the query helper toolbar:

Screen Shot 2018-04-11 at 17.45.35.png (500×1 px, 24 KB)

For now we can exclude that bootstrap-table version in package.json, but how do we proceed after that? File a bug report against bootstrap-table? (I would be surprised if we’re the only people whose website this breaks…)

Event Timeline

I think I fixed it in https://gerrit.wikimedia.org/r/c/425099/ but it may not be the correct fix. It fixes the issue for me.

Yeah, I just saw that… I assume it works (I just hadn’t pulled that commit yet), but I don’t like it: it might still break at any time if another library decides that it wants to restyle fullscreen-toggle as well. So I’m still not sure what to do now, to be honest.

We could switch to doing it by ID, not by class, and use reasonably prefixed IDs. Shouldn't that fix the issue with libraries stepping on our toes with their classes? Or just add wdqs- prefix to our classes - I don't think any library would use that.
My fix was more stopgap measure to not break production GUI. Please feel free to improve it.

Well, quite frankly I think it’s the library authors who should use prefixes for their classes – it shouldn’t be our job to tiptoe around them any time we upgrade our dependencies.

I’ve submitted a pull request for bootstrap-table, let’s see what happens.

Yeah generally it's a Bad Thing (TM) to hog something as generic as class name fullscreen to one library. But we may as well have additional line of defense...
In any case it seems like master is fine for now, but if bootstrap updates we may want to bump the version.

I think fullscreen-toggle makes sense anyways, so I don’t think we need to revert your change or anything.

Lucas_Werkmeister_WMDE claimed this task.

The pull request was merged, and I don’t think there’s anything else we can do here… let’s hope this doesn’t happen too often in the future.