patrickomeara
Repos
25
Followers
26
Following
37

Simple locale information and methods for react native

43
26

A framework for building native applications using React

105101
21467

Primary source of truth for the Docker "Official Images" program

5514
1783

Private PaaS built on native AWS services for maximum privacy and minimum upkeep

1858
170

Events

issue comment
Input inside modal inside dropdown overlay not responding to arrow keys

This issue shouldn't have been closed, this is breaking some very basic user interaction. Opening a modal from a menu to change some text is a very common UX in web apps.

I'm in a similar situation to @TimDeanMoser with lots of modals from menu items. Putting them outside the Menu.Item would be a nightmare to maintain.

I've used @johuder33's implementation a little differently by stopping the propagation from the input. An example can be found here https://codesandbox.io/s/antd-reproduction-template-forked-x2hke5

The number allows up and down as it increments and decrements the value. Alternatively, you could stop only the arrow keys, however it had no effect stopping all keys from going further up the DOM in my use case.

<Form form={form}>
  <Form.Item name="string" label="String">
    <Input onKeyDown={(e) => e.stopPropagation()} />
  </Form.Item>
  <Form.Item name="number" label="Number">
    <InputNumber
      onKeyDown={(e) => {
        // stop left and right, allow up and down as they increment and decrement the value
        if ([37, 39].includes(e.which)) {
          e.stopPropagation();
        }
      }}
    />
  </Form.Item>
  <Form.Item name="textarea" label="Textarea">
    <Input.TextArea onKeyDown={(e) => e.stopPropagation()} />
  </Form.Item>
</Form>

Thanks for the workarounds @johuder33 and @schoinh, and thanks for reporting the issue @TimDeanMoser

Created at 2 weeks ago
issue comment
Input doesn't respond to w3c standard interaction for element clear

I also tried this with RcInput and the got the same appended result, so the problem is within that package. I will add an issue there.

If anyone stumbles upon this issue using Laravel Dusk I worked around it by overriding the type method.

The type method now selects the text and deletes it prior to typing the new text. Not an ideal solution, but it works.

    // This overrides InteractsWithElements::type() as AntDesign's Input does not respond to clear()
    public function type($field, $value)
    {
        $controlKey = OperatingSystem::onMac() ? '{command}' : '{control}';
        $this->resolver
            ->resolveForTyping($field)
            ->sendKeys($this->parseKeys([[$controlKey, 'a'], '{backspace}', $value]));

        return $this;
    }
Created at 2 weeks ago
started
Created at 3 weeks ago
issue comment
Input doesn't respond to w3c standard interaction for element clear

@patrickomeara

It's name. Otherwise the new text wouldn't be appended.

Created at 3 weeks ago
opened issue
Input doesn't respond to w3c standard interaction for element clear

Reproduction link

https://codesandbox.io/s/antd-reproduction-template-forked-n98f62

Steps to reproduce

As this needs a browser test using webdriver, I have set up a Laravel Dusk repo. Dusk uses PHP Webdriver initially created by facebook. https://github.com/php-webdriver/php-webdriver.

The below test code could be implemented in any language that uses the w3c webdriver standard to the same result.

The browser test will test the site at https://n98f62.csb.app/

The following steps should reproduce the issue, although the php/composer install can be different depending on your system.

  • git clone https://github.com/patrickomeara/antd-w3c-driver-clear && cd antd-w3c-driver-clear
  • brew install php composer
  • composer install
  • php artisan dusk:chrome-driver
  • php artisan dusk

The final command should fail and create a screenshot in ./tests/Browser/screenshots (embedded below)

What is expected?

The following code is ran in the test

$this->browse(function (Browser $browser) {
    $browser->visit('https://n98f62.csb.app/')
        ->waitFor('input[name=input]', 15)
        ->type('input', 'This clears the input')
        ->type('ant-input', 'This adds to the existing text')
        ->assertInputValue('input', 'This clears the input')
        ->assertInputValue('ant-input', 'This adds to the existing text');
});

The w3c webdriver spec states that calling POST /session/{session id}/element/{element id}/clear should clear the element. The Input component doesn't follow this standard.

What is actually happening?

The type() method calls clear() but only the html input element is cleared, the ant design Input is not.

Screenshot

failure-Tests_Browser_AntDesignClearElementTest_testExample-0

| Environment | Info | | --- | --- | | antd | 4.23.0 | | React | 18.2.0 | | System | MacOS 12.5.1 | | Browser | Firefox 105/Chrome 104 |

Created at 3 weeks ago

Upgrade to latest antd, react and react-dom

Created at 3 weeks ago
patrickomeara create branch main
Created at 3 weeks ago
patrickomeara create repository
Created at 3 weeks ago
issue comment
php-cs-fixer > 3.9.5 causes LogicException in caching layer

I'm also having this issue. Thanks for writing it up @billypoke

To pin 3.9.5: composer require friendsofphp/php-cs-fixer:v3.9.5

Created at 1 month ago

withoutUpdatedTimestamp

  • allow the developer to ignore all, multiple or a single updated timestamp
  • creating will always set the timestamp and ignores the ignore :)

withoutUpdatedTimestamp functionality for builder

withoutUpdatedTimestamp functionality for upsert

test updateOrCreate and firstOrCreate

testWithoutTouchingStillUpdatesTheSameModel

  • test to assert that calling withoutTouching on the same model still updates the timestamp
Created at 2 months ago

Move tests that only test HasTimestamps methods

Created at 2 months ago

testWithoutTouchingStillUpdatesTheSameModel

  • test to assert that calling withoutTouching on the same model still updates the timestamp
Created at 2 months ago
issue comment
[9.x] Add withoutUpdatedTimestamp()

Hi @henzeb thanks for looking through this PR.

As far as I am aware, withoutTouching() only prevents touching parent relationship's timestamps not the model itself.

Docs

https://laravel.com/docs/master/eloquent-relationships#touching-parent-timestamps

Existing Test

Testing asserting that the model is touched but parent isn't

https://github.com/laravel/framework/blob/ae76bf60795117e28e7beb64346bc2011e195c23/tests/Database/DatabaseEloquentIntegrationTest.php#L1858-L1883

Created at 2 months ago

test updateOrCreate and firstOrCreate

Created at 2 months ago
issue comment
[8.x] Add `timestamps` to model save options

See #43441

Created at 2 months ago

withoutUpdatedTimestamp functionality for upsert

Created at 2 months ago

withoutUpdatedTimestamp functionality for upsert

Created at 2 months ago

withoutUpdatedTimestamp functionality for upsert

Created at 2 months ago

Add functionality to upsert

Created at 2 months ago

withoutUpdatedTimestamp functionality for builder

Created at 2 months ago

withoutUpdatedTimestamp

  • allow the developer to ignore all, multiple or a single updated timestamp
  • creating will always set the timestamp and ignores the ignore :)
Created at 2 months ago

withoutUpdatedTimestamp

  • allow the developer to ignore all, multiple or a single updated timestamp
  • creating will always set the timestamp and ignores the ignore :)
Created at 2 months ago
pull request opened
[9.x] Add withoutUpdatedTimestamp()

Many times I needed to run a command that updates a model without updating the updated_at column. This might be migrating data or a client wants to make a batch change to their data without losing the existing updated_at.

Usually I reach for one of the two options:

// iterate over and set timestamps to false - slow
$users->each(function ($user) {
    $user->timestamps = false;
    $user->update(['something' => 'here']);
});

// extend the model in the command and set timestamps to false - dirty
UsersWithoutTimestamps::query()->update('something' => 'here']);

// ...
class UsersWithoutTimestamps extends User {
    public $timestamps = false;
}

Recently I've come across the withoutTouching static method, which had me thinking "why don't we have this for updated_at?" 🤔

So here it is.

You can now ignore all models updated_at timestamps via Model::withoutUpdatedTimestamp()

Model::withoutUpdatedTimestamp(function () use ($user, $post, $comment) {
    // no change to updated_at
    $user->update(['something' => 'here']);
    $post->update(['something' => 'here']);
    $comment->update(['something' => 'here']);
});

...or ignore mulitple models updated_at timestamp via Model::withoutUpdatedTimestampOn()

Model::withoutUpdatedTimestampOn[User::class, Post::class], function () use ($user, $post, $comment) {
    // no change to updated_at
    $user->update(['something' => 'here']);
    $post->update(['something' => 'here']);
    // updated_at will be set
    $comment->update(['something' => 'here']);
});

...or ignore a single model updated_at timestamp via User::withoutUpdatedTimestamp()

User::withoutUpdatedTimestamp(function () use ($user, $post, $comment) {
    // no change to updated_at
    $user->update(['something' => 'here']);
    // updated_at will be set
    $post->update(['something' => 'here']);
    $comment->update(['something' => 'here']);
});

Be default new models set updated_at and created_at when the model is created. This functionality has stayed the same as it's a data integrity issue. So creating models in the callback will still have updated_at set

User::withoutUpdatedTimestamp(function() use ($user) {
    // no change to updated_at
    $user->update(['something' => 'here']);

    // updated_at will be set as usual
    $player = User::create(['name' => 'Patrick']);
});
Created at 2 months ago

withoutUpdatedTimestamp

  • allow the developer to ignore all, multiple or a single updated timestamp
  • creating will always set the timestamp and ignores the ignore :)
Created at 2 months ago

[9.x] Standardise invokable rule translation functionality (#42873)

  • Improve invokable rule translation capabilities

  • align with existing functionality

Fixed league/flysystem suggest (#42872)

Allow for nullable morphs in whereNotMorphedTo (#42878)

  • use the null safe operator to return null polymorphic relationships

Clear cast cache when setting attributes using arrow (#42852)

remove failures method declaration (#42889)

Co-authored-by: Adam Rodriguez adamr@healthendeavors.onmicrosoft.com

Fixed Mail::assertNot... annotations (#42898)

[9.x] introduce a fake() helper to resolve faker singletons, per locale (#42844)

  • introduce a fake() helper to resolve a faker singleton

  • code style

[9.x] Allow handling cumulative query duration limit per DB connection (#42744)

  • allow handling query duration limit per connection

  • add docblocks

  • improve naming

  • ensure handler can trace all previous queries when logging is active

  • formatting

  • method rename

Co-authored-by: Taylor Otwell taylor@laravel.com

[9.x] Add invokable option to make rule command (#42742)

  • Add invokable option to make rule command

  • formatting

  • Minor style fix

  • Add support for the combination of invokable and implicit

  • Update src/Illuminate/Foundation/Console/stubs/rule.invokable.implicit.stub

Co-authored-by: Tim MacDonald hello@timacdonald.me

Co-authored-by: Taylor Otwell taylor@laravel.com Co-authored-by: Tim MacDonald hello@timacdonald.me

version

version

[8.x] Added changelog

[9.x] Added changelog

add test for collection multiple wheres (#42908)

[9.x] Allow instance of Enum pass Enum Rule (#42906)

  • Update Enum Rule

  • Fix StyleCI

[9.x] Add new allowMaxRedirects method to PendingRequest (#42902)

  • Add new allowMaxRedirects method to PendingRequest

  • formatting

Co-authored-by: Taylor Otwell taylor@laravel.com

[9.x] Add support to detect dirty encrypted model attributes (#42888)

  • Add encypted casts

  • Style CI changes

  • Bugfix “The payload is invalid.”

Only compare if the original is not null

[9.x] Vite (#42785)

  • Add Vite helpers

  • Remove vite helper

  • Add @viteReactRefresh directive

  • Add docblock

  • Remove unused import

  • Automatically clean up after tests

  • Use ASSET_URL when resolving assets

  • support default entrypoint

  • update docblock

  • Linting

  • Support CSS entry points

  • Remove default entry points

Blade apps and SPAs have different entry point requirements so there is no sensible default.

  • Fix test namespace

Co-authored-by: Lucas Michot 513603+lucasmichot@users.noreply.github.com

  • Add missing import

Co-authored-by: Tim MacDonald hello@timacdonald.me Co-authored-by: Lucas Michot 513603+lucasmichot@users.noreply.github.com

Fix wrong PHPDoc for sortBy related method of Collections (#42921)

Test and annotate that Arr::pull() works with int keys (#42927)

This pull request corrects the type hint of the argument $key in Illuminate\Support\Arr::pull() to allow int keys. This avoids false-positives from IDEs and static analysis tools.

In order to ensure it actually works as intended, I added a test case.

Created at 2 months ago