# Proposal: remove the drawer dependency

**URL:** <https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972>\
**Category:** Development\
**Tags:** proposal\
**Created:** [August 17, 2023, 8:45am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972 "2023-08-17T08:45:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [August 17, 2023, 8:45am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/1 "2023-08-17T08:45:16Z")

</div>

Hello!

In the context of [XWIKI-18007: Drawer menu improvements for accessibility](https://jira.xwiki.org/browse/XWIKI-18007), I had to [question the legitimity](https://github.com/xwiki/xwiki-platform/pull/2225#issuecomment-1600476452) of relying on an external library to handle the drawer. As we needed a lot of changes done and the [bootstrap 3 drawer library](https://github.com/iqbalfn/bootstrap-drawer) we were relying on didn’t get any updates in 4 years, I thought it would be easier to remove the dependency and implement its behaviour back in a few lines in [a new PR](https://github.com/xwiki/xwiki-platform/pull/2282). Note that this PR also implements extended accessibility for the drawer and has a delta (+) of only 160 lines.

I think the drawer library is not useful anymore because modern CSS support makes it trivial to style one ourselves. The most difficult part of a drawer is to handle how the user can interact with it. Keyboard navigation (which represents a fair part of the ways an user can interact with an element) and accessibility were barely accounted in the library.  
In bootstrap 5, the [offcanvas component](https://getbootstrap.com/docs/5.0/components/offcanvas/) holds this role.

The changes are proposed in [this PR](https://github.com/xwiki/xwiki-platform/pull/2282).  
What do you think of this change? Do you agree with the proposal to remove the dependency to `bootstrap drawer`?

Have a good day!  
Lucas C.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [August 17, 2023, 10:06am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/2 "2023-08-17T10:06:26Z")

</div>

Thanks for the proposal @CharpentierLucas

Haven’t read the proposal closely yet, but I remember we search for an alternative drawer component some time ago because we needed to be able to open several drawers on the same page (the current one, plus another one for displaying What’s new entries iirc).  
Is is something you plan to support and/or could support with the code proposed in your PR?

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [August 17, 2023, 11:20am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/3 "2023-08-17T11:20:32Z")

</div>

> [@mleduc](#):
>
> Is is something you plan to support and/or could support with the code proposed in your PR?

It’s not that complicated to extend the code proposed in my PR to make it support multiple drawers. 🙂 I didn’t make it generic yet as this is not needed in the context of the PR. Should I spend some time on making it generic right now so it’ll be straightforward to implement another drawer later?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 17, 2023, 11:26am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/4 "2023-08-17T11:26:36Z")

</div>

> [@CharpentierLucas](#):
>
> Should I spend some time on making it generic right now so it’ll be straightforward to implement another drawer later?

Would be nice as I need that to move the What’s New feature properly to use a drawer (which I think is a better UI) 🙂

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [August 17, 2023, 12:00pm UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/5 "2023-08-17T12:00:22Z")

</div>

> [@vmassol](#):
>
> Would be nice as I need that to move the What’s New feature properly to use a drawer (which I think is a better UI) 🙂

Okay, I set the PR as a draft and I’ll be spending time on improving it soon 🙂

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [August 17, 2023, 12:04pm UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/6 "2023-08-17T12:04:07Z")

</div>

So, +1 on my side to remove the dependency to the current drawer external dependency and to define our own instead.  
While I’m usually not a fan of rebuilding thing ourselves:

- this is indeed supposed to be a small and easy feature
- earlier review of existing alternatives showed that there is not much available (especially if we take into account additional requirements such as multi drawers as mentioned above).

---

<div class="post-metadata">

**Author:** ![Simpel](https://forum.xwiki.org/user_avatar/forum.xwiki.org/simpel/32/3655_2.png) [@Simpel](https://forum.xwiki.org/u/Simpel)\
**Post date:** [August 17, 2023, 5:55pm UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/7 "2023-08-17T17:55:15Z")

</div>

I definitely vote for a change. The current drawer didn’t pass the BITV (german wcag) in many points, so we decided to omit the drawer completely and put the needed buttons onto the upper topmenu (with javascript) and some needed links onto the lower topmenu.

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [September 15, 2023, 7:19am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/8 "2023-09-15T07:19:07Z")

</div>

> [@mleduc](#):
>
> So, +1 on my side to remove the dependency to the current drawer external dependency and to define our own instead.  
> While I’m usually not a fan of rebuilding thing ourselves:
> 
> - this is indeed supposed to be a small and easy feature
> - earlier review of existing alternatives showed that there is not much available (especially if we take into account additional requirements such as multi drawers as mentioned above).

Same as Manuel, so +1. Thanks!

---

<div class="post-metadata">

**Author:** ![MichaelHamann](https://forum.xwiki.org/user_avatar/forum.xwiki.org/michaelhamann/32/3813_2.png) [@MichaelHamann](https://forum.xwiki.org/u/MichaelHamann)\
**Post date:** [September 15, 2023, 8:02am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/9 "2023-09-15T08:02:49Z")

</div>

+1, thank you!

---

<div class="post-metadata">

**Author:** ![CharpentierLucas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/charpentierlucas/32/4830_2.png) [@CharpentierLucas](https://forum.xwiki.org/u/CharpentierLucas)\
**Post date:** [September 25, 2023, 7:56am UTC](https://forum.xwiki.org/t/proposal-remove-the-drawer-dependency/12972/10 "2023-09-25T07:56:04Z")

</div>

I have updated [the PR for XWIKI-18007: Drawer menu improvements for accessibility](https://github.com/xwiki/xwiki-platform/pull/2282) to make it generic and allow features to use their own drawers. 🙂
