Skip to content

Setting borderWidth to 0 defaults back to 1 #68

Description

@NickH-nz

This Issue is about a bug in API v2.0.5

My aim is to not show a border around the input field.

When setting the borderWidth to 0, it counts as not being set and defaults to 1. Setting to -1 works around the issue and allows the border to be hidden.

The borderWidth property does not do a comprehensive check to see if it is defined. Other properties have a more comprehensive check that should be applied to all numeric options.

The issue can be found here:
https://github.com/orange-games/phaser-input/blob/master/build/phaser-input.js#L599

Old:

_this.borderWidth = inputOptions.borderWidth || 1;

New:

_this.borderWidth = (typeof inputOptions.borderWidth === 'number') ? inputOptions.borderWidth : 1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions