awcodes / filament-sticky-header

A Filament Panels plugin to make headers sticky when scrolling.
MIT License
54 stars 8 forks source link

Dynamic Title Not Supported #18

Closed freshleafmedia closed 11 months ago

freshleafmedia commented 11 months ago

Consider the following:

class PageResource extends Resource
{

    public static function form(Form $form): Form
    {
        $form
            ->schema([
                TextInput::make('title'),
            ]);
    }
}
class EditPage extends EditRecord
{
    protected function getTitle(): string
    {
        return $this->getRecord()->title;
    }
}

This displays the current title of the record as the title of the page and updates when the page is saved.

Once the sticky header has stuck for the first time the title no longer updates on save and a full page refresh is required before it will update. This occurs even if the header is stuck and then unstuck.

I suspect the offending line is https://github.com/awcodes/filament-sticky-header/blob/eb51d9bf3c603207fccb40bc99ccd653f62d2b8d/resources/js/plugin.js#L43

awcodes commented 11 months ago

hmm. It kinda needs to be ignored otherwise it will loose it's position on page refresh. I'll see what I can do.

awcodes commented 11 months ago

might be able to solve it in Filament v3 with Livewire's persist