Polymer dialog paper with floating point paper animation

I started today with Polymer and I am very excited about what I collect with this! But I ran into a problem, I don’t know how to solve it, if you added it <paper-input floatingLabel>inside <paper-dialog>, the paper dialog loses cool animation. Is there a way around the animation, or is this a known issue when an animated component is inside another animated component?

When I received the vote, I decided to provide a code that will help you help me:

<!DOCTYPE html>
<html>
<head>
    <!-- 1. Load platform.js for polyfill support. -->
    <script src="bower_components/platform/platform.js"></script>

    <!-- 2. Use an HTML Import to bring in the element. -->
    <link rel="import" href="bower_components/core-icons/core-icons.html">
    <link rel="import" href="bower_components/core-overlay/core-overlay.html">
    <link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
    <link rel="import" href="bower_components/core-transition/core-transition.html">
    <link rel="import" href="bower_components/paper-dialog/paper-dialog.html">
    <link rel="import" href="bower_components/paper-dialog/paper-dialog-transition.html">
    <link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
    <link rel="import" href="bower_components/paper-input/paper-input.html">
    <link rel="import" href="bower_components/paper-toast/paper-toast.html">

    <link rel="stylesheet" href="stylesheets/style.css"/>

    <style shim-shadowdom>
        /* Coloquei Junto com os inputs */
        body {
            font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
            margin: 0;
            padding: 24px;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            -webkit-touch-callout: none;
        }

    </style>


</head>
<body unresolved touch-action="auto">

<core-toolbar style="background-color: #f5f5f5">
    <span flex>
        <img src="images/logo_Positivo.png"/>
    </span>
    <paper-button label="Login" class="colored" onclick="toggleDialog('paper-dialog-transition')"></paper-button>
</core-toolbar>

<paper-dialog heading="Login" transition="paper-dialog-transition" style="background-color: #efefef">
    <div>
        <img src="/images/academia.png" class="gym_logo"/>
        <img src="/images/default_user.png" class="usr_logo"/>
    </div>
    <!--<paper-input floatingLabel label="Chave"></paper-input><br/>-->
    <paper-input floatingLabel label="Usuário"></paper-input><br/>
    <paper-input floatingLabel label="Senha"></paper-input><br/>

    <paper-button label="Entrar" class="colored" affirmative default onclick="document.querySelector('#toast3').show();disparaLogado();"></paper-button>

</paper-dialog>

<paper-dialog heading="Login" transition="paper-dialog-transition" id="logado">

    Logado!!!

</paper-dialog>

<paper-toast id="toast3" class="capsule" text="Acessando o sistema e validando dados..." style="padding-right: 60px;" duration="5000"></paper-toast>
<script>
    function toggleDialog(transition) {
        var dialog = document.querySelector('paper-dialog[transition=' + transition + ']');
        dialog.toggle();
    }
    function disparaLogado() {
        selecionarModulos = window.setTimeout(function () {
            var logado = document.querySelector('paper-dialog#logado');
            logado.toggle();
        }, 5000);
    }
</script>
</body>
</html>

I added the following line at the end of paper-dialog-transition.html:

<paper-dialog-transition id="paper-dialog-transition" transitionType="fade"></paper-dialog-transition>

Thanks for any help or comment!

+4
source share
2 answers

, , :

<paper-dialog transition="core-transition-bottom">

. transition - .

,

0

, , .

-1

Source: https://habr.com/ru/post/1546737/


All Articles