syncfusion / ej2-react-ui-components

Syncfusion React UI components library offer more than 50+ cross-browser, responsive, and lightweight react UI controls for building modern web applications.
https://www.syncfusion.com/react-ui-components
Other
349 stars 103 forks source link

MultiSelectComponent #8

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

I have a problem with the MultiSelectComponent in React, specifically with the placeholder property.

Consider this link.

As you can see in the demo, when you unselect all the previous selected options, the placeholder "Select countries" appears again just as the beginning, but in the StackBlitz example associated the placeholder dissapears after selecting and unselecting all the options, so the placeholder can only be obtained again if the page is refreshed. It seems to be related to the version of the package ej2-react-dropdowns. The demo is just using an old version of the package and the StackBlitz example is using the last version, as I can see in package.json file. So I think it is incorrect as it is implemented now, this feature should be implemented as it was before, it's not logical that the placeholder dissapears. So will you correct it? Did you do that in purpose?

Regards, Néstor Llamas Llopis

ghost commented 5 years ago

Hello,

I've been studying the case and I've found the solution about your code. The file affected in last versions of the ej2-react-dropdowns package, at least in the last version 16.4.55, is the one in the path \node_modules\@syncfusion\ej2-dropdowns\src\multi-select\multi-select.js, specifically on line 1367. So there is a mistake in the declaration of the function refreshPlaceHolder in the conditional statement if ((this.value && this.value.length) || !isNullOrUndefined(this.text)). Check the function:

MultiSelect.prototype.refreshPlaceHolder = function() {
  if (this.placeholder && this.floatLabelType === 'Never') {
    if ((this.value && this.value.length) || !isNullOrUndefined(this.text)) {
      this.inputElement.placeholder = '';
    } else {
      this.inputElement.placeholder = this.placeholder;
    }
  } else {
    this.setFloatLabelType();
  }
  this.expandTextbox();
};

On previous versions that had this feature well implemented, for example in version 16.4.52 from 5th February 2019, the conditional statement looked like if (this.value && this.value.length), so as you can see there was not the new extra condition !isNullOrUndefined(this.text).

So in the correct old version 16.4.52, whenever the value is an empty string (no options selected from the MultiSelectComponent) it will place the placeholder properly, while in the incorrect new version 16.4.55, whenever the value is an empty string it will reset the placeholder with an empty string, and this should not happen.

As now is implemented, when all the options from the component are unselected, the value is set to an empty string and matches the condition !isNullOrUndefined(this.text), so it will reset the placeholder to an empty string. As it was before in previous correct versions, whether the value was null, undefined, or an empty string it placed the placeholder properly, and when the value was a non-empty string it reseted it properly. But as it is now is just doing it the incorrect way.

So please, can you consider in publishing a new last official version of the package ej2-react-dropdowns where you remove the second condition !isNullOrUndefined(this.text) from the conditional statement that I mentioned? This will fix the issue. I think this is the only thing you must modify, but if you consider there are other things affected to this just modify them too, please.

Regards, Néstor Llamas Llopis

Gopigovin commented 5 years ago

Hi Néstor Llamas Llopis,

Thank you for using Syncfusion products.

We have validated the reported issue in our EJ2 MultiSelect component. We have already considered this as a defect in our end. The fix for the issue will be included in our upcoming 2019 Volume 1 release. You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/5253

Regards, Gopi G.

ghost commented 5 years ago

OK, thank you. When will be released the new version you are talking about?

Gopigovin commented 5 years ago

Hi Néstor Llamas Llopis,

Thank you for your update.

The fix will be included in the upcoming volume 1 main release which is expected to be rolled by the end of this month. We will let you know once the release is available for download.

Regards, Gopi G.

PrinceOliver commented 5 years ago

Hi @nestorllamas,

We are glad to announce that our Essential Studio Volume 1, 2019 release (v17.1.0.38) is rolled out and is available for download under the following link.

https://www.syncfusion.com/forums/143619/essential-studio-2019-volume-1-release-v17-1-0-38-is-available-for-download

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards, Prince

ghost commented 5 years ago

Hello,

OK, I've installed your last version. But I want to discuss something. The placeholder appears when unselecting all the previous selected options and when making click outside of the component (blur event). But maybe it would be better to showing it just when unselecting all the previous selected options (so no need to click outside of the component)? I think this way would be more good in terms of usability. What do you think? Will you consider this or you will let it as it is now?

Regards, Néstor Llamas Llopis

Gopigovin commented 5 years ago

Hi Néstor Llamas Llopis,

Thank you for your update.

We have checked your scenario and we are considering this as bug. The fix for the issue will be included in our upcoming patch release scheduled on April 10th, 2019. You can now track the current status of the reported issue, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/5253

Regards, Gopi G.

Gopigovin commented 5 years ago

Hi Néstor Llamas Llopis,

Thank you for your patience.

We have fixed the reported issue and the fix is included in the version 17.1.40. Kindly refer to the following release notes section: https://ej2.syncfusion.com/documentation/release-notes/17.1.40/#multiselect

We suggest you upgrade to the latest version in your application. Please let us know if you need any further assistance on this.

Regards, Gopi G.

ghost commented 5 years ago

OK, thank you!