Comments (10)
After a bit of searching, I think this issue could be related to #318 and/or #297.
In the meantine, I also created a codepen reprex which might help further narrow down the issue :)
from virtual-select.
@sa-si-dev Could you help on this one?
from virtual-select.
So the issue is that there is no call to virtualSelect.setVisibleOptionsCount(...);
If this is manually included, there is no longer any issue - see here https://codepen.io/MichalLauer/pen/RwOqWgr.
Would it be possible to fix it somewhere in the package? I am not very familiar with JS project structure so I'm not sure where to include it.
Edit: So there might be something more going on. In my app, I am using a custom regex
function searchLabel(searchValue, virtualSelect) {
...
const regex = new RegExp(`(?<!\S)${word}`, "gi");
...
}
and when I call the function virtualSelect.setVisibleOptionsCount(...);
, the search no longer respects it and uses the default one. To make it respect the custom function, I need to manually set the counter:
```js
function searchLabel(searchValue, virtualSelect) {
...
virtualSelect.setServerOptions(grouped_data);
virtualSelect.visibleOptionsCount = visible;
virtualSelect.afterSetVisibleOptionsCount();
}
The reprex can be found here - https://codepen.io/MichalLauer/pen/wvZQWpe.
from virtual-select.
Hi @MichalLauer
I had a similar issue so I decided to look at the code and try to fix this.
Created a draft PR with a possible solution, could you please help validate this before opening the PR itself (I'm just having some issues running the tests, where 3 are failing, even though I can't manually get any error but would like double check to mitigate the risk of introducing any regression issue)?
You'll need to go ahead and get my branch, build it and use the Dev Tools overrides.
from virtual-select.
Hi @MichalLauer
Did you get the chance to test the code from my draft PR?
from virtual-select.
Hey,
I tried to build the branch yesterday but could not run any npm run
or npm install
commands because of authentication. I tried to create an NPM account, but that did not help either. I want to try again on Thursday. Do you have an idea what might have caused it? I tried googling, but nothing helped.
I am not primarily a JS developer, so I'm not very fluent with npm - I just know the basic stuff.
from virtual-select.
Hey, I tried to build the branch yesterday but could not run any
npm run
ornpm install
commands because of authentication. I tried to create an NPM account, but that did not help either. I want to try again on Thursday. Do you have an idea what might have caused it? I tried googling, but nothing helped.I am not primarily a JS developer, so I'm not very fluent with npm - I just know the basic stuff.
Hi @MichalLauer
I didn't have to do anything like that.
You should be able to run npm install
and after that npm run build
to generate the dist
files
from virtual-select.
Fixed in release v1.0.43.
from virtual-select.
Hello,
thanks @gnbm for the update and PR! I'm sorry I did not manage to test the changes earlier.
I can confirm that the original issue (https://codepen.io/MichalLauer/pen/RwOqWgr) is fixed. However, a custom regex is still not respected in the version 1.0.43 and the previous code reprex on version 1.0.43 does not work - https://codepen.io/MichalLauer/pen/XWQOVpo.
There, I am using a custom regex to search and return values (line 5). For example, if you search for "c b a", I want to return all items that contain "c", "b", and "a". The regex correctly identifies them and prints them (lines 8 - 10). However, nothing is printed in the virtual select.
Should I create another issue for this?
from virtual-select.
Hello @MichalLauer
The problem you're reporting is not related to the one you confirmed is fixed, so it should be treated separately.
Being a custom regex and a custom function I would first debug your code to understand if the issue is really in Virtual Select itself.
from virtual-select.
Related Issues (20)
- Dropbox has blurry borders in Chromium browsers HOT 2
- when using server search, disableSelectAll doesn't work HOT 6
- When using popup mode and preselected values make the focus go to the dropdown when entering the screen
- The "disabled" property doesn't account for the tabindex. HOT 7
- Inline Style Css Properties is not Showing HOT 1
- Add property in the documentation HOT 1
- deselectAllOnlyVisible feature HOT 1
- Broken display of options with icons HOT 4
- Add classes to button HOT 3
- The search input is disabled when allowNewOption is set to true and the options are empty. HOT 5
- Search Feature Unresponsive After Setting an Empty List of Options HOT 3
- The reset() method is triggering on change event and causing an infinite loop when used on certain contexts HOT 1
- Custom values in onServerSearch are not respected HOT 1
- Scrolling gets stuck in Safari when multiple select has options selected HOT 2
- why i get the wrong in browser console: index.vue:62 Couldn't initiate Virtual Select HOT 1
- Search and Select not working with Groups HOT 1
- Dropdown gets blank after scroll to bottom and changing browser zoom
- first option always selected even when autoSelectFirstOption set to false
- When setting maxValues, first option is always selected HOT 1
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 virtual-select.