hotwired / hotwired/stimulus

Change obeserver not called if controller name contains uppercase characters

Open
#680 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
13.1k
Forks
441
PR merge metrics
No merged PRs in 30d

Description

I have encountered this behaviour that I believe to be a bug, where if a controller name contains an uppercase letter, value change callbacks are never fired.

Everything behaves as expected after converting the controller name to lowercase.

Please see this codepen for a demonstration: if you click the button, the text on the page does not change, however, if you rename the controller from Test to test (there are 4 occurrences in the html and 1 occurrence in the javascript) the text on the page changes after clicking the button. Tested on Firefox and Chrome.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodePen and compare the uppercase Test controller with the lowercase test version, focusing on the value change callback behavior after clicking the button. The work is done when callbacks fire and the page text changes consistently for controller names containing uppercase characters in both Firefox and Chrome.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.