Ditch paper-tabs from discards WebUI |
|
Issue descriptionFWIW, we are trying to remove paper-* dependencies as much as possible going forward. Could you explore if cr-view-manager at [1] can be used here instead of <paper-tab>? Again, this is for a separate CL. [1] https://cs.chromium.org/chromium/src/ui/webui/resources/cr_elements/cr_view_manager/cr_view_manager.html
,
Nov 15
A very minimal new example is at https://cs.chromium.org/chromium/src/chrome/browser/resources/md_user_manager/user_manager_pages.html. See the CL at https://chromium-review.googlesource.com/c/chromium/src/+/1029952/. Does that help?
,
Nov 15
Linked to the wrong CL. Here is the correct link https://chromium-review.googlesource.com/c/chromium/src/+/1327420.
,
Nov 15
> It looks like perhaps this is just a convenience element to provide the switchView() function, and everything else has to be done by the enclosing elements and logic? Also, cr-view-manager takes care of the transition animations, as well as properly styling the active and non-active views (where by "styling" I mean hiding/showing). The enclosing element's responsibility is to simply call switchView(viewId) as necessary, where |viewId| should match the ID of an element that has slot="view".
,
Nov 15
I agree that the cr-view-manager documentation needs improvement (it is basically non-existent). The other fairly convenient functionality that it provides is to fire the following 4 events on the views that are entered/exited. view-enter-start (start of animation) view-enter-finish (end of animation) view-exit-start view-exit-finish These can be very useful, for example if you need to focus a certain UI element once a view becomes active.
,
Nov 16
Thanks, I can now hold cr-view-manager right. I started looking into replacing the paper-tabs with cr-toolbar, but that seems like overkill. Can you recommend (and point to) some way for making the "one from closed set of views" selection?
,
Nov 16
> I started looking into replacing the paper-tabs with cr-toolbar, but that seems like overkill. cr-toolbar is not equivalent to paper-tabs > Can you recommend (and point to) some way for making the "one from closed set of views" selection? I don' think we have our own "cr" equivalent element for this. iron-selector [1] could be an alternative to paper-tabs, but this is still a 3rd party dependency, so probably not worth migrating to. [1] https://cs.chromium.org/search/?q=%22%3Ciron-selector%22+-file:third_party+-file:infra+-file:out/Debug+-file:out/chromium-android/Debug+-file:out/android-Debug+-file:src/v8+-file:src/native_client-sdk+-file:src/out/&type=cs |
|
►
Sign in to add a comment |
|
Comment 1 by siggi@chromium.org
, Nov 15