Skip to content

"disable" is broken, because onFocus ignores it #766

Closed
@jrochkind

Description

@jrochkind

If you send the "disable" method, the instance var disabled is set to true

the onkeypress event and onkeyup event both check for disabled, and return doing nothing if disabled.

However, the onFocus event does not. And the onFocus event triggers an onValueChange which results in suggestions being fetched and displayed.

As a result, if you've disabled the autocomplete, and then focus elsewhere and then click in the input again to focus the input:

  • Suggestions are fetched and displayed on focus, even though it is disabled
  • Those suggestions show up, your cursor is still in the input, now you type some things: The new things you typed do not trigger a fetch/display of suggestions, the suggestions stay fixed to what they were when you focused. Because the code that would trigger new suggestions on you changing content in the input is respecting the disabled state.

This makes no sense at all. I think onFocus has got to return early if disabled as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions