Comments (4)
Thanks for the rapid response this is awesome! But i think good to mention that on the documentation. Thanks for the help and have a great time.
from preline.
window.onload = function () { const el = HSTabs.getInstance('#hs-tab-to-select-1' ,true); if(el) { el.on('change', ({ el, prev, current }) => { console.log('change ***********++++++', el, prev, current) }); } else { console.log('el is null',el) } }
Problem: Encountering a null reference error when trying to use HSTabs.getInstance within window.onload. The variable el is expected to hold an instance but is consistently null, leading to issues when trying to access its properties or methods.
Hello,
Could you create an example and share it with us on Stacklblitz? We have not yet encountered such a problem during testing and use, perhaps this is a specific case.
Thank you in advance!
from preline.
Sure! Here is the link. Thank you very much!
https://stackblitz.com/edit/stackblitz-starters-bzuiv3?file=index.html
from preline.
Sure! Here is the link. Thank you very much!
https://stackblitz.com/edit/stackblitz-starters-bzuiv3?file=index.html
Thanks for the live link!
The problem is that you need to use a different selector, by default the plugin looks for all selectors [role="tablist"]:not(select):not(.--prevent-on-load-init)
, in your case, you need to use the [hs-data-tab-select="#tab-select"]
selector when trying to get the instance.
You can check a working example here
from preline.
Related Issues (20)
- i.current is undefined when setTimeout to load HSStaticMethods.autoInit();
- Overlay Component Issues : public method & events not working HOT 1
- Issue: Some JavaScript behavior options are not functioning correctly, and there is a lack of precise documentation regarding their usage HOT 1
- Preline Dropdown only works after hard refresh HOT 7
- Instructions for Selecting an Option in HSSelect
- Documentation needs improvements regarding JS options & methods , with some options not working or lacking information!
- Steps on number input HOT 1
- collapse component not working on chrome, works in Firefox HOT 1
- Scrolling bug in the Scrollspy plugin in Chrome HOT 1
- Advanced Select Not displayed as expected in Nextjs HOT 1
- Vertically centered modals don't work HOT 3
- layout shift due to removal of scroll bar in browser HOT 2
- Second level dropdown does not work in firefox but does work in chrome HOT 1
- Search Issue with Non-Latin Characters in Select Plugin HOT 1
- Preline doesn't work with Solid.js and solid-start HOT 1
- Functions not working in React-Inertia project HOT 2
- javascript plugin not working HOT 1
- Preline Javascript plugin not working HOT 3
- Cannot dismiss opened Advanced Select controls while using FireFox HOT 3
- Unable to use Preline Examples in Remix App HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preline.