Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: google/blockly
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: blockly-v12.0.0-beta.6
Choose a base ref
...
head repository: google/blockly
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: blockly-v12.0.0-beta.7
Choose a head ref
  • 4 commits
  • 7 files changed
  • 3 contributors

Commits on May 14, 2025

  1. Configuration menu
    Copy the full SHA
    4a2b743 View commit details
    Browse the repository at this point in the history
  2. feat: Add support for conditional ephemeral focus. (#9051)

    ## The basics
    
    - [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)
    
    ## The details
    ### Resolves
    
    Needed for fixing google/blockly-samples#2514 and google/blockly-samples#2515.
    
    ### Proposed Changes
    
    Update `FieldInput` along with drop-down and widget divs to support disabling the automatic ephemeral focus functionality.
    
    ### Reason for Changes
    
    As mentioned in google/blockly-samples#2514 (comment) both google/blockly-samples#2514 and google/blockly-samples#2515 were caused by the custom fields leading to both drop-down and widget divs simultaneously taking ephemeral focus (and that's not currently allowed by `FocusManager`). This change updates both widget and drop-down divs with _optional_ parameters to conditionally disable automatic ephemeral focus so that `FieldInput` can, in turn, be customized with disabling automatic ephemeral focus for its inline editor. Being able to disable ephemeral focus for `FieldInput` allows the custom fields' own drop-down divs to take and manage ephemeral focus, instead, avoiding the duplicate scenario that led to the runtime failure.
    
    Note that the drop-down div change in this PR is completely optional, but it's added for consistency and to avoid future scenarios of breakage when trying to use both divs together (as a fix is required in Core without monkeypatching).
    
    It's worth noting that there could be a possibility for a more 'proper' fix in `FocusManager` by allowing multiple calls to `takeEphemeralFocus`, but it's unclear exactly how to solve this consistently (which is why it results in a hard failure today). The main issue is that the current focused node can change from underneath the manager (due to DOM focus changes), and the current focused element may also change. It's not clear if the first, last, or some other call to `takeEphemeralFocus` should take precedent or which node to return focus once ephemeral focus ends (in cases with multiple subsequent calls).
    
    ### Test Coverage
    
    No new tests were added, though common field cases were tested manually in core's simple playground and in the plugin-specific playgrounds (per the original regressions). The keyboard navigation plugin test environment was also verified to ensure that this didn't alter any existing behavior (it should be a no-op except for the two custom field plugins).
    
    Automated tests would be nice to add for all three classes, perhaps as part of #8915.
    
    ### Documentation
    
    The code documentation changes here should be sufficient.
    
    ### Additional Information
    
    These changes are being done directly to ease solving the above samples issues. See google/blockly-samples#2521 for the follow-up fixes to samples.
    BenHenning authored May 14, 2025
    Configuration menu
    Copy the full SHA
    083329a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    215fad8 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2025

  1. Configuration menu
    Copy the full SHA
    8c0ee9f View commit details
    Browse the repository at this point in the history
Loading