Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
danyaridiger committed Apr 4, 2024
1 parent 4353307 commit 671ca68
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 17 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Patch notes

Current vue-extended-multiselect version: **0.5.0**
Current vue-extended-multiselect version: **0.5.1**

***

Expand Down Expand Up @@ -103,4 +103,8 @@ Current vue-extended-multiselect version: **0.5.0**
### 0.5.0 (2024-04-04)

* Changing behaviour of "select" event: it no longer fires after setting preselected options.
* Fixing bug with incorrect modelValue type in preselected options setter method.
* Fixing bug with incorrect modelValue type in preselected options setter method.

### 0.5.1 (2024-04-04)

* Fixing bug with incorrect options list placement.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-extended-multiselect",
"version": "0.5.0",
"version": "0.5.1",
"description": "Extended multiselect component for applications based on Vue 2 framework",
"keywords": [
"multiselect",
Expand Down
6 changes: 4 additions & 2 deletions src/components/ExtendedMultiselectMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
>
<div :class="classes">
<span>{{ optionCreateLabel(option) }}</span>
<div :class="deselectClasses">
<div
:class="deselectClasses"
@click.stop="deselectBlock(index)"
>
<img
alt=""
class="extended__multiselect_deselect-block-icon"
v-if="!showLoaderIcon"
:src="require('../assets/cancel.svg')"
@click.stop="deselectBlock(index)"
/>
<extended-multiselect-loader
v-else
Expand Down
3 changes: 2 additions & 1 deletion src/components/VueExtendedMultiselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
type="transition"
>
<extended-multiselect-options
ref="extendedMultiselectOptions"
v-if="dropdownActive"
:auto-select-created-option="autoSelectCreatedOption"
:clear-by-select-when-multiple="clearBySelectWhenMultiple"
Expand Down Expand Up @@ -285,7 +286,7 @@ import store from "../vuex/store";
* @mixes ToggleMixin
* @mixes CancelMixin
* @mixes PreselectedOptionsMixin
* @version 0.5.0
* @version 0.5.1
*/
export default Vue.extend({
name: "VueExtendedMultiselect",
Expand Down
28 changes: 19 additions & 9 deletions src/mixins/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,15 @@ export default {
* @returns {string} position
*/
toggleAppearanceRestrictor() {
if (!window) return "under";
if (!window || !this.$refs.extendedMultiselectOptions) return "under";

const innerHeight = window.innerHeight;
const offsetHeight = this.$refs.extendedMultiselectOptions.offsetHeight
+ this.$refs.extendedMultiselect.offsetHeight;
const offsetTop = this.$refs.extendedMultiselect.getBoundingClientRect().y;
const difference = innerHeight - offsetTop;

if (difference > this.toggleMaxHeight) {
if (difference > offsetHeight) {
return "under";
} else {
return "atop";
Expand All @@ -324,7 +326,7 @@ export default {
* @method
*/
toggleAppearanceRestrictorActivate() {
if (!this.dropdownActive) {
if (this.dropdownActive) {
this.chosenToggleAppearanceSide = this.toggleAppearanceSide !== "auto"
? this.toggleAppearanceSide
: this.toggleAppearanceRestrictor();
Expand Down Expand Up @@ -444,15 +446,17 @@ export default {
toggleOptions() {
if (this.internalLoading || this.disabled || this.dropdownDisabled) return;

this.toggleAppearanceRestrictorActivate();
this.dropdownActive = !this.dropdownActive;

this.$nextTick(() => {
this.toggleAppearanceRestrictorActivate();
});

if (!this.dropdownActive) {
this.activeEmitter();
} else {
this.closeEmitter();
}

this.dropdownActive = !this.dropdownActive;
},

/**
Expand Down Expand Up @@ -577,10 +581,12 @@ export default {
this.emitter.$on("extended:expand-options", () => {
if (this.dropdownActive || this.dropdownDisabled) return;

this.toggleAppearanceRestrictorActivate();
this.activeEmitter();

this.dropdownActive = true;

this.$nextTick(() => {
this.toggleAppearanceRestrictorActivate();
});
this.activeEmitter();
});

this.emitter.$on("extended:rollup-options", () => {
Expand Down Expand Up @@ -760,6 +766,10 @@ export default {
&& typeof this.options !== "function"
) {
this.dropdownActive = true;

this.$nextTick(() => {
this.toggleAppearanceRestrictorActivate();
});
}

this.emitter.$on("extended:loader-pattern-changed", (pattern) => {
Expand Down

0 comments on commit 671ca68

Please sign in to comment.