Skip to content

[RC.0] ion-button in toolbar: still appears as disabled until hovered after enabling #16892

Closed

Description

@simonhaenisch

Bug Report

Ionic version:

[x] 4.x

Current behavior:

An ion-button within a header toolbar is initially rendered as disabled. When removing the disabled attribute from that button (e. g. by clicking another button), the button still appears disabled, until it is hovered.

Expected behavior:

The button should immediately appear enabled.

Steps to reproduce:

https://codepen.io/simonhaenisch/pen/ZVJWbb

Related code:

<ion-app>
  <ion-header>
    <ion-toolbar color="primary">
      <ion-title>Ionic 4 - RC.0</ion-title>
      <ion-buttons slot="end">
        <ion-button id="prev" disabled>
          <ion-icon slot="icon-only" name="arrow-back"></ion-icon>
        </ion-button>
        <ion-button id="next">
          <ion-icon slot="icon-only" name="arrow-forward"></ion-icon>
        </ion-button>
      </ion-buttons>
    </ion-toolbar>
  </ion-header>
</ion-app>

<script>
  const prevButton = document.querySelector('ion-button#prev');
  const nextButton = document.querySelector('ion-button#next');

  nextButton.addEventListener('click', () => {
    prevButton.disabled = false;
  });

  prevButton.addEventListener('click', () => {
    prevButton.disabled = true;
  });
</script>

Other information:

It doesn't happen if the buttons are just in the ion-content.

Edit: also doesn't happen in iOS mode (it's enough to put mode="ios" on the back button).

Ionic info:

Ionic:

   ionic (Ionic CLI) : 4.6.0

System:

   NodeJS : v8.14.1
   npm    : 6.5.0
   OS     : macOS Mojave

Activity

  1. manucorporat commented on Dec 28, 2018

    @manucorporat
    Contributor

    Looks like a bug of chrome, i can't reproduce in Safari.
    Wondering if we can find a workaround

  2. ionitron-bot commented on Feb 21, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  3. locked and limited conversation to collaborators on Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions