New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Providing multiple errors in one alertWithTyp() function call throws a warning #115
Comments
hi @VicFrolov the title and message are converted to strings and a warning is logged out. These parameters are expected to be string types. I suppose the warning could be suppressed if the parameters can be converted. If they can't be converted then an warning should appear and fails displaying the alert. |
Got it, how would you recommend passing multiple errors, where each error is on a separate line? With an array, it does this for me for free, otherwise the error looks instead of:
like this: |
I haven't tried it but you can maybe get away with |
I think you wold agree that this wouldn't be an optimal approach, and should be done under the hood. I personally believe (and could be wrong) that a more intuitive approach is to allow passing in an array of errors, where the number of lines is the length of the array. I'd be happy to make a PR if you agree with this perspective. The down side of course is passing an error as a simple string vs an array with one item is more intuitive. Having said that, I still find an array of |
I am going to leverage the discussion and make an enhancement to the title and message parameters. Basically, in a way to be more defensive and flexible. |
Acceptance criteria
|
@VicFrolov OK so I ran into an issue. I was testing an array of messages like: const messages = ['Do laborum ipsum deserunt laboris fugiat fugiat deserunt Lorem esse culpa exercitation est dolore deserunt.', 'Non magna nulla incididunt ullamco sint incididunt Lorem qui Lorem anim ullamco pariatur aliquip sunt.', 'Enim eu excepteur laborum eu magna ea exercitation veniam exercitation reprehenderit.']; I then separate messages to new lines with |
I'm closing based on previous comment and no bandwidth to work on it. In |
Short Description
I've noticed that if I pass an array of errors, e.g. ["password field is blank", "password fields do not match"], it works perfectly, as I set the numOfLines to the length of the array, and it shows the data appropriately.
However, I am getting a warning "DropdownAlert: Message is not a string". I wanted to know if I should be passing the data differently, or if this requires a PR, and an array of strings is indeed valid.
Steps to Reproduce / Code Snippets / Usage
With the example source code, change the alertWithType line to:
this.dropdown.alertWithType('error', 'Error', ['Error 1', 'Error2', 'Error3');
and
Expected Results
No Warning being thrown
Additional Information
The text was updated successfully, but these errors were encountered: