Skip to content
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

Hiding MDB form elements with if/else blocks throws an error #16

Open
davidb-wz opened this issue Feb 26, 2021 · 4 comments
Open

Hiding MDB form elements with if/else blocks throws an error #16

davidb-wz opened this issue Feb 26, 2021 · 4 comments

Comments

@davidb-wz
Copy link

Issue
Try to hide some form elements like MDBInput or MDBBtn with Svelte if/else condition and this error appears in the developer console :
Uncaught (in promise) in mdbsvelte.es.js

Reproduce
In App.svelte :

<script>
	import { MDBBtn }from "mdbsvelte"
	let action = "show";
</script>

{#if action === "show"}
	<MDBBtn on:click="{() => action = 'hide'}">Hide this button</MDBBtn>
{/if}

Then npm run dev and check the developer console when clicking the button
Tested in firefox 86 and Google Chrome 88

@atsepkov
Copy link

atsepkov commented Oct 3, 2021

I'm seeing the same error when trying to build an accordion element. The element expands correctly, but trying to shrink it again, I see the following error:

mdbsvelte.es.js:formatted:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'c')
    at gt (mdbsvelte.es.js:formatted:1)
    at Object.o (mdbsvelte.es.js:formatted:1)
    at transition_out (mdbsvelte.es.js:formatted:1)
    at Object.outro [as o] (mdbsvelte.es.js:formatted:1)
    at transition_out (mdbsvelte.es.js:formatted:1)
    at Object.update [as p] (mdbsvelte.es.js:formatted:1)
    at update (mdbsvelte.es.js:formatted:1)
    at flush (mdbsvelte.es.js:formatted:1)

Were you able to find a workaround?

@rfrankspk
Copy link

I am seeing this issue as well...
Did anyone find a work around or the proper way to accomplish this?

@atsepkov
Copy link

Ended up using a different UI library, this one does not seem to be maintained anymore.

@granitrocky
Copy link

I'm running into the same issue with an {#each} block inside and MDBContainer. It looks related to the props that are getting forwarded to Svelte and related functions being run before Svelte can find the component.

Looks like I wasted a day trying to use a dead project. Oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants