The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

Problem With Drawer


Version: Metronic HTML v8.2.5 Demo1

Problem, page: https://preview.keenthemes.com/metronic8/demo1/apps/customers/list.html
SS: (open mobile and click chat)

Workaround: The issue is that it causes the width of the page to be calculated differently as the page loads. In this page, this is caused by DataTable. For example, this problem does not exist on the home page. Chat works fine there.

The solution I implemented was by putting the KTComponents.init() code in scripts.bundle.js into the JQuery ready event.

Strangely, the "document.addEventListener("DOMContentLoaded",..........." code does not work here, I don't understand it. That's why I used JQuery.

Thanks.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (7)

 
Deleted comment
Deleted comment
Deleted comment
Deleted comment
Deleted comment
Deleted comment
 
Deleted comment

Hi,

Please try to use KTUtil's dom ready event handler for your logic:


KTUtil.onDOMContentLoaded(function () {
// your code goes here...
});


Regards.



Hi,

File: scripts.bundle.js

Working code:
Not Working 1:
Not Working 2:

I don't want to use jQuery.
When will you release an update regarding this issue?



Hi,

Are you putting the init code after all core js include, at the bottom of your page as a custom script ? For example custom-init.js.

I think the issue is related to datatable loading.
Can you try to use responsive datatable so that during the loading it won't break the page head and lead to width miscalculation for drawers? You can try to wrap the datatable with a div and use table-responsive class for it.

Regards.



Hi,
You can see the problem live from here: https://preview.keenthemes.com/metronic8/demo1/apps/customers/list.html



Hi,

As a workaround for the issue can you try to use data-kt-drawer-width="{default:'300px', 'lg': '500px'}" attribute instead?

Regards.



Hi,
Absolutely dude! This fixed it and it worked!
Thanks <3



Hi happy,

Glad to hear that. All the best with your projects.

Regards.


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.