I am trying to set the X position of a toast notification. The documentation shows that this can be set using the following:
<ToastPosition X="Center"></ToastPosition>
However, if I try to do this directly in the HTML (on a server-side Blazor project), it shows the following error message:
The name 'Center' does not exist in the current context
And if I try to set it directly in code via the controls reference like so:
toastSuccess.Position = "Center"
It gives the following error:
Cannot implicitly convert type 'string' to 'Syncfusion.EJS2.Blazor.Notifications.ToastPosition'
However, if I write one of the following:
<ToastPosition X=@(new ToastPosition(){ X = "Center" }))></ToastPosition>
toastSuccess.Position = new ToastPosition() { X = "Center" };
Then no error message is reported and the project compiles/runs but the toast won't show. If I completely remove all code trying to set the position, then the toast will successfully show in the upper right hand corner of the window. However, once it disappears, if I click the button to open it again, it won't open and the following error is reported in the Google Chrome console:
e.match is not a function
TypeError: e.match is not a function
at https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:11837
at le (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:13181)
at Object.Db.compile.e.compile (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:477637)
at ce (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:13424)
at t.fetchEle (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:7523367)
at t.setContent (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:7528933)
at t.personalizeToast (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:7525455)
at t.show (https://cdn.syncfusion.com/ej2/17.2.34/dist/ej2.min.js:1:7521287)
at call (https://cdn.syncfusion.com/ej2/17.2.34/dist/ejs.interop.min.js:1:7115)
at https://localhost:44361/_framework/blazor.server.js:8:21434
If I refresh the page, then clicking the button shows the toast message again, but only on the first click and all subsequent clicks show the above error message.